subject
Physics, 26.03.2021 18:40 jaleahwalker

Submit to Webcourses the developed concurrency. cm source code fileAssignment requirements1. Two producers2. Two consumers3. Mutual exclusion4. Single buffer with maximum size 10 elements5. Maximum 30 items produced and consumed for each producer-consumer pair TasksActivityconcurrency. cm1. Create a new CM source code file named concurrency. cm2. Declare the following global variables a. Data type semaphore named full b. Data type semaphore named emptyc. Data type semaphore named mutexd. Constant integer, value 10, for the maximum size of the buffer that stores the produced itemse. Integer array with the size as defined in step d. f. Constant integer, value 30, for the maximum number of produced items for each producer3. Write function producer to do the following a. Return type void b. Parameter list receives one integer designating the producer number (1.e. producer 1, producer 2) c. Loop while the producer has not produced the maximum of 30 items i. Apply exclusive lock on semaphores (i. e. wait or p) ii. Produce the item iii. Add item to buffer iv. Output to screen the produced item v. Calculate the next position in the buffer for the next item vi. Unlock semaphores (i. e. signal or v)

ansver
Answers: 3

Another question on Physics

question
Physics, 21.06.2019 23:00
We want to calculate the total metabolic heat generated by a singing canary taking into account heat transfer by radiation, convection and exhaling air. the air temperature is 20 oc, canary’s body internal and surface temperature is 33oc, external body surface convective heat transfer coefficient is 25.2 w/m2 .k, temperature difference between the inhaled and exhaled air is 4.3 oc, the ventilation rate is 0.74 cc of air per second, specific heat of air is 1.0066 kj/kg.k and density of air is 1.16 kg/m3 . assume the canary’s body to be a cylinder with 7 cm diameter and 9 cm length, and heat exchange is from the side as well as the top and bottom of cylinder. calculate 1) the net rate of heat lost by radiation, assuming heat gained by the bird through radiation from the surroundings is 11.5 w; 2) rate of heat transferred by convection to the surrounding air; 3) rate of heat transferred in the exhaling air without considering any internal evaporation; 4) total metabolic power.
Answers: 2
question
Physics, 22.06.2019 03:00
1. a net force of 100 newton’s is applied to a wagon for 5 seconds. this causes the wagon to undergo a change in momentum of
Answers: 2
question
Physics, 22.06.2019 15:00
What happens to an isotope during radioactive decay?
Answers: 2
question
Physics, 22.06.2019 18:00
Athin nonconducting rod with a uniform distribution of positive charge q is bent into a circle of radius r. the central perpendicular axis through the ring is a z-axis, with the origin at the center of the ring. a) what is the magnitude of the electric field due to the rod at z = 0? n/c (b) what is the magnitude of the electric field due to the rod at z = infinity? n/c (c) in terms of r, at what positive value of z is that magnitude maximum? r (d) if r = 4.00 cm and q = 9.00 µc, what is the maximum magnitude? n/c
Answers: 1
You know the right answer?
Submit to Webcourses the developed concurrency. cm source code fileAssignment requirements1. Two pro...
Questions
question
Mathematics, 09.04.2020 17:52
question
History, 09.04.2020 17:52
question
Mathematics, 09.04.2020 17:53
Questions on the website: 13722361