|
From: Hans - D. <dul...@eg...> - 2000-08-31 20:45:27
|
I have come to the conclusion mentioned in the subject line. The way I understand 'recursion' in the context of a semaphore is as follow. A thread has a lock on a semaphore and wants to lock it again. Is this right? In the case of Mutex and Gateway, obtaining a lock means gaining access to a resource and hence the thread is actively performing some work. However, in the case of Event, obtaining a lock means that the requesting thread is willing to stop working and wait (i.e. block itself) until an event occurs. So, if the requesting thread is blocked for an event (in the queue of the corresponding EventSemaphore), it would never be possible for this thread to recurse and try to obtain any other lock. Please verify this statement. Your comments will affect how the EventSemaphore is implemented. -- Hans Dulimarta, Ph.D. dul...@co... P: 517-432-7589 http://www.egr.msu.edu/~dulimart F: 760-281-7691 http://corelinux.sourceforge.net Elec. & Comp. Engg., Mich. State Univ., E. Lansing, MI 48824 |