A latching question.


R. Clayton (rclayton@monmouth.edu)
(no date)


  If the calling process tries to latch the same lock twice, is it blocked the
  on the second attempt?

Yes; any process that tries to latch a latched lock blocks. In your case some
other process would need to also have access to the lock, otherwise the blocked
process is deadlocked (with itself).

Locks that do not have this self-blocking property are known as re-entrant
locks: a process may latch any lock it has already latched any number of times
without deadlock. Java mutex semaphores (synchronization blocks) are
re-entrant; posix semaphores are not.

You operating system should provide self-blocking locks; they are easier to
define and implement than are re-entrant locks.



This archive was generated by hypermail 2.0b3 on Mon Dec 16 2002 - 22:00:05 EST