G
Guest
Hi,
I'm new to threading, and am trying to understand monitor.pluse. I get the
general idea, but what does this offer that simply using a semaphore does not
offer? If you have two threads, couldn't you just immediately have one thread
in the ciritical section and have the other try to enter. It will wait until
the lock is handed back, and the lock could continue to be passed back and
forth this way. The off thread will sleep until it's its turn. How is this
different than "pulsing" a thread to a ready queue before handing a lock back?
Thanks..
-Ben
I'm new to threading, and am trying to understand monitor.pluse. I get the
general idea, but what does this offer that simply using a semaphore does not
offer? If you have two threads, couldn't you just immediately have one thread
in the ciritical section and have the other try to enter. It will wait until
the lock is handed back, and the lock could continue to be passed back and
forth this way. The off thread will sleep until it's its turn. How is this
different than "pulsing" a thread to a ready queue before handing a lock back?
Thanks..
-Ben