Re: In project 4, why do we need the mutex?

55 views
Skip to first unread message

Partha Dasgupta

unread,
Nov 4, 2017, 7:17:58 PM11/4/17
to LEI, asu-cse-531-fall-2007
You cannot create any critical section anywhere using producer/consumer semaphores. 

If each port consists of a static array of buffers, critical sections are not needed, as there are no conflicts. However if they are dynamic, or use arrays, critical sections are necessary.

The project description asks you to use critical sections.


Partha Dasgupta,
ASU/CIDSE/Computer Science & Eng. 
EMail: par...@asu.edu
http://cactus.eas.asu.edu/partha

On Sat, Nov 4, 2017 at 2:01 PM, LEI <leig...@gmail.com> wrote:
In the requirement of project 4, noticed "

Strategy 1: A mutex semaphore for all ports, and a producer semaphore and a consumer semaphore - per port

Strategy 2: Same as 1, but a mutex per port.

"

For both the strategies, since we can use the producer semaphore and the consumer semaphore to create critical section on any port, why do we need a global or local mutex?
What are we going to do with the mutex?

--
You received this message because you are subscribed to the Google Groups "asu-cse-531-fall-2007" group.
To unsubscribe from this group and stop receiving emails from it, send an email to asu-cse-531-fall-2007+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages