|
Boost : |
From: Greg Colvin (gcolvin_at_[hidden])
Date: 1999-12-28 20:46:39
From: <scleary_at_[hidden]>
> > I recall a convincing presentation to the committee
> > that you can't trust library-based threading because
> > optimizers might reorder operations around the library
> > calls. That might be what Bjarne was referring to.
> >
>
> But we do have language support -- 'volatile' introduces sequence points
> (1.9p7), so I would assume that it would be possible to write such a library
> that the compiler could not reorder. Interesting, though, I never thought
> of this before. . .
It's not optimization within the library call that hurts,
it's optimization around the library call, so it you would
have to put volatile in your own code to protect it from
thread switches. I think it's sort of like the restrictions
on setjmp, but I hurd this talk years ago and don't recall
the deatials.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk