What is the effect of interchanging bpb and pe in the


Consider this code for the producer-consumer problem: semaphore e = n, f = 0; /* e = empty buffer, f = full buffer */ binary_semaphore b = 1; producer: while (1) { P(e); bP(b); add_to_buffer; bV(b); V(f); } consumer: while (1) { P(f); bP(b); take_from_buffer; bV(b); V(e); }

(1) What is the effect of interchanging bP(b) and P(e) in the producer process in the producer-consumer problem?

(2) What is the effect of exchanging bV(b) and V(f) in the producer process in the producer-consumer problem?

Solution Preview :

Prepared by a verified Expert
Computer Engineering: What is the effect of interchanging bpb and pe in the
Reference No:- TGS01522219

Now Priced at $10 (50% Discount)

Recommended (97%)

Rated (4.9/5)