Answer:
Explanation:
Following are the Semaphores:
Customers: Counts waiting customers;
Barbers: Number of idle barbers (0 or 1)
mutex: Used for mutual exclusion.
Cutting: Ensures that the barber won’t cut another customer’s hair before the previous customer leaves
Shared data variable:
count_cust: Counts waiting customers. ------------copy of customers. As value of semaphores can’t access directly.
// shared data
semaphore customers = 0; semaphore barbers = 0; semaphore cutting = 0; semaphore mutex = 1;
int count_cust= 0;
void barber() {
while(true) { //shop is always open
wait(customers); //sleep when there are no waiting customers
wait(mutex); //mutex for accessing customers1
count_cust= count_cust-1; //customer left
signal(barbers);
signal(mutex);
cut_hair();
}
}
void customer() {
wait(mutex); //mutex for accessing count_cust
if (count_cust< n) {
count_cust= count_cust+1; //new customer
signal(customers); signal(mutex);
wait(barbers); //wait for available barbers get_haircut();
}
else { //do nothing (leave) when all chairs are used. signal(mutex);
}
}
cut_hair(){ waiting(cutting);
}
get_haircut(){
get hair cut for some time; signal(cutting);
}
Pie chart I believe that is the right answer
Answer:
Restate financial statement for the first and second year.
Prepare financial statement of year 3 reflecting the effects of error from year one and two
Explanation:
A revision of the the entire financial statement from year one will be helpfull, when this is re-stated for the first and second year. Then in stating the amount of assets and liabilities carried into year three, the cummulative effect of the error from the previous two years should be reflected.
Photography allows us to view the world around us in different ways, by giving us the sense and feel of what others feel, Photography is art. You are able to use photography to define actions, for example happiness in a marriage or happiness in children playing at the park. Photography also allows you to explore and discover new things, and make something out of that. It makes you think a bout different ways to change the world around you, how do you define the world?