Boost logo

Boost :

From: Darryl Green (green_at_[hidden])
Date: 2001-08-06 00:22:25


> -----Original Message-----
> From: John Max Skaller [mailto:skaller_at_[hidden]]
> Sent: Monday, 6 August 2001 8:07 AM
> To: boost_at_[hidden]
> Subject: [boost] Re: boost.threads
>
>
> williamkempf_at_[hidden] wrote:
> >
> > --- In boost_at_y..., williamkempf_at_h... wrote:
> Question: does anyone share stack data between threads?
>
> Reason for asking:
>
> 1) Bemans model tries to ban this
> 2) I objected
>
> but it occurs to me that on a multi-processor, the constraint
> would allow CPU local memory to be used for the stack, which
> could be a significant optimisation.

Interesting - I have never shared stack data between
threads in any environment. I suppose part of the
reason may have been the programming language and
libraries in use - but it looks like a nasty can
of worms to me.
If the data is shared it must obviously be guarded
appropriately, but it is perfectly possible that
the terminating thread doesn't have a lock on the
data in question to start with. It certainly won't
(just as well) when it ceases to "exist" and in
particular when the OS actually frees the stack.
I've encountered realtime kernels that allow or
require stack space to be provided by the user
(passed as a parameter to thread creation) and
in this case the storage will obviously outlive
the thread - but managing it would still be ugly,
and of course this isn't really relevant to a
cross platform thread library (except, maybe,
as a hint that there should be at least some
consideration given to platforms that are neither
pthreads nor WIN32 compatible).
I can't help thinking I must have misunderstood
your point somehow? In what way did you envisage
the sharing of stack data being useful - or were
you just concerned that someone might have a use
for it?

Darryl Green


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