Question: Activity Directions: Consider a scenario in which several processes compete for access to the same resource (e.g., a file or some memory address). When a

Activity Directions:

Consider a scenario in which several processes compete for access to the same resource (e.g., a file or some memory address). When a process is starved due to resource unavailability, a timer is used to stop (i.e., kill) the process after a predetermined time interval. Once the process is terminated, attempt to gain access to the desired resource.

For example, a user could be prompted programmatically to check if a process is not available, and if not available, then the process could be terminated. This would simulate the same process users perform with the Task Manager on Windows or the Activity Manager on the Mac. Createa C program that implements the scenario using two processes that are created using fork(). Print the necessary process data using fprintf to show a log of activities: which processes are running, what resource they are trying to access, whether the resource is available, and whether the process is starved.

After analyzing the activity log produced by your program, assess how efficient the use of a timer to solve deadlock situations was. Is the solution scalable to multiple processes and threads? What are the limitations, if any? If you identified problems with this strategy, suggest a different approach and explain why it would be better. If the timer proves to be a successful approach, just state that and no further alternatives need to be explored.

Deliverables:

1. Detailed description of the scenario explaining your approach to implementation in C.

2. Include a flowchart that demonstrates the logic of the program.

Activity Directions: Consider a scenario in which several processes compete for accessto the same resource (e.g., a file or some memory address). Whena process is starved due to resource unavailability, a timer is used

3. Consider the jointly Gaussian random variables X and Y that have the following joint PDF: r 2 2pxy fx, y (x, y ) = exp 2TOXOY V 1 - p2 2(1 - p2) OXOY (a) Prove that Y is a Gaussian random variable by deriving its marginal PDF, fy(y). Find the mean and variance of Y. (b) Prove that fxy(xly) corresponds to another Gaussian random variable, then find its mean and variance.Prob 2 Let Z1 ~ N(0, 1) be a standard Gaussian random variable. Let W be a independent Bernoulli 1/2 random variable. Define a random variable Z2 as follows [Z1 if W = 0 Zz = -Z1 if W = 1. 1. Show that Z2 ~ N(0, 1). 2. Show that Z1 + Z, is not a Gaussian random variable. Can you describe the "pdf" of Z1 + Zz? Conversely, we call two Gaussian random variables X] and X2 to be jointly Gaussian iff every linear combination of X1 and X2 is a Gaussian random variable (not necessarily with mean 0 and variance 1). In future classes on machine learning, communication and signal processing, you will explore this setup in much more detail. 3. Show that if X1 and X2 are independent /(0, 1) random variables, then X1 and X2 are jointly Gaussian. The converse is not true jointly Gaussian random variables need not be independent.. This homework is designed to make you familiar with different random variable generating functions in MATLAB. Problem 1: Gaussian Random Variable (a) Generate a Gaussian random variable with mean = 0, variance = 1. (b) Generate a Gaussian random variable with mean = 5, variance = 0.1. (c) Generate a 10-by-1 sequence of Gaussian random variables whose each element is independent and identically distributed with mean = 0, variance = 1. (d) Repeat the problems (a) to (c) when the Gaussian random variables have ex- pected value = 5 and variance = 0.01

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!