comp.lang.ada
 help / color / mirror / Atom feed
* Re: Distributed Reader-Writer Mutex by Dmitry Vyukov
       [not found] <k1bkoj$vkm$1@dont-email.me>
@ 2012-08-26  7:36 ` Dmitry A. Kazakov
  0 siblings, 0 replies; only message in thread
From: Dmitry A. Kazakov @ 2012-08-26  7:36 UTC (permalink / raw)


On Sat, 25 Aug 2012 18:48:47 -0500, aminer wrote:

> So i think you have to use a critical section around the for loop to be able
> to lock all the rwlocks at the same time to avoid the deadlock problem..

Assuming that the critical section is system-wide, however that would not
prevent deadlock because arrays of mutexes are naturally exposed to
deadlocks.

Considering the example you refer to, the array of mutexes does not
deadlock (I am guessing), because all mutexes are taken and always in the
same order.

In any case, you should never do anything blocking within a critical
section, and if you had system-wide critical sections available, you could
implement system-wide mutex without resorting to individual mutexes.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-08-26  7:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <k1bkoj$vkm$1@dont-email.me>
2012-08-26  7:36 ` Distributed Reader-Writer Mutex by Dmitry Vyukov Dmitry A. Kazakov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox