Question: Create a function called sensor_value that randomly generates a number between (0 and 3). Create a new function called Gate_Control that uses the function
Create a function called sensor_value that randomly generates a number between (0 and 3). Create a new function called Gate_Control that uses the function sensor_value to generate two semaphores: Gate and Counter. The semaphore Gate is passed if the output is 2. On the other hand the semaphore Counter is passed if the output is 1, or 3). Then create a thread using the Gate_Control function. C should be used and code should be ready to be executed
Step by Step Solution
3.51 Rating (148 Votes )
There are 3 Steps involved in it
include include include include include int sensorvalueint ... View full answer
Get step-by-step solutions from verified subject matter experts
