Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Apr 2015 23:05:17 +0800
From:      Julian Elischer <julian@freebsd.org>
To:        Dheeraj Kandula <dheerajktech@gmail.com>, freebsd-threads@freebsd.org
Subject:   Re: Clarification: Acquiring a mutex when a read write lock is held
Message-ID:  <5537B8AD.5060009@freebsd.org>
In-Reply-To: <CAJ5QSa0bNy0gh_h=s=C8k2i7J4KvSBDEcMdDrtD8T0GPX3PZug@mail.gmail.com>
References:  <CAJ5QSa0bNy0gh_h=s=C8k2i7J4KvSBDEcMdDrtD8T0GPX3PZug@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 4/21/15 6:30 PM, Dheeraj Kandula wrote:
> Hey All,
>         Can you clarify the following
>
> I have a read write lock locked. Next I want to acquire a mutex when the
> read write lock is held. Is this allowed or not. As far as I can understand
> from the "FreeBSD Kernel Developers Handbook" this operation is allowed in
> FreeBSD9.0, 10.0 and further.
>
> But the read write lock cannot be held while sleeping. Doesn't this
> contradict the above statement, as a thread will go to sleep if can't
> acquire the mutex when another thread holds the mutex.
>
> Hence what sleep are we referring here. Is this sleep(unbounded sleep) or

look at

      man 9 locking

for an overview.

> the bounded sleep.
>
> Dheeraj
> _______________________________________________
> freebsd-threads@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-threads
> To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org"
>
>




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5537B8AD.5060009>