Boost logo

Boost :

Subject: Re: [boost] [future N2561] Implementation comments
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2008-12-03 09:59:41

----- Original Message -----
From: "Anthony Williams" <anthony.ajw_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, December 03, 2008 2:18 PM
Subject: Re: [boost] [future N2561] Implementation comments

> "vicente.botet" <vicente.botet_at_[hidden]> writes:
>> Ok, I see. Do we need to set_value from different threads? Should
>> the promise::set_value() be thread safe or not? What says the C++0x
>> standard?
> The C++0x draft standard is silent on the matter. I think it probably

So the idea is that a promise should be used only by a thread. Right?
>>> Protection of lazy_init would require a different mechanism, such as
>>> the use of boost::call_once.
>> Why not?

Sorry, I would like to say why not!
>> I was not talking of move-assigning but to take the address which
>> preserve the promise contents and is dangerous if concurrent calls
>> to set_value are not supported with this implementation. So, why not
>> delete the operator&()?
> Just because something is not thread safe does not make it appropriate
> to delete the operator&. You can pass things around by pointer without
> making them accessible to more than one thread, and you can pass
> things by reference that ARE accessible by more than one thread, even
> if that isn't safe.

You are right. It is enough to state that this is not thread safe.

Thanks for all,

Boost list run by bdawes at, gregod at, cpdaniel at, john at