comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Distributed Reader-Writer Mutex by Dmitry Vyukov
Date: Sun, 26 Aug 2012 09:36:35 +0200
Date: 2012-08-26T09:36:35+02:00	[thread overview]
Message-ID: <2e1e5vd3umdz.17cznxo58oakq.dlg@40tude.net> (raw)
In-Reply-To: k1bkoj$vkm$1@dont-email.me

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



           reply	other threads:[~2012-08-26  7:36 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <k1bkoj$vkm$1@dont-email.me>]
replies disabled

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