Boost logo

Boost :

From: Darryl Green (green_at_[hidden])
Date: 2001-08-09 19:37:42


> -----Original Message-----
> From: Beman Dawes [mailto:bdawes_at_[hidden]]
> Sent: Friday, 10 August 2001 7:32 AM
> To: boost_at_[hidden]; 'boost_at_[hidden]'
> Subject: RE: [boost] Re: boost.threads
>
> How about this as a FAQ entry (I'm not sure where else to put it):
>
> Q. Is it safe for threads to share automatic storage duration (stack)
> objects via pointers or references?
>
> A. Only if you can guarantee lifetime of the stack object
> will not end
> while other threads might still access the object. Thus the safest
> practice is to avoid sharing stack objects, particularly when
> in designs
> where threads are created and destroyed dynamically.
> Restrict sharing of
> stack objects to simple designs with very clear and
> unchanging function and
> thread lifetimes.
>
> Comments?
>
> --Beman

Sounds good to me.

Darryl.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk