Boost logo

Boost Users :

Subject: Re: [Boost-users] [Thread] why isn't it possible to acquire 2 different upgrade_lock from 2 different threads?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2014-03-27 13:11:43


AMDG

On 03/27/2014 09:09 AM, Elad Moshe wrote:
>> If both threads tried to upgrade, you would have a deadlock.
>
> But how is it possible? isn't the upgrade operation atomic?
> if the 2 threads try to upgrade, one will succeed and the other one will
> block until the first thread will unlock.
>

If it worked this way, it would mean that upgrade
lock would not exclude concurrent writes, which
completely defeats the point of using it in the
first place.

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net