[cpp-threads] Editorial comments on the straw man

Ben Hutchings ben at decadentplace.org.uk
Thu Jan 19 23:58:08 GMT 2006


On Thu, 2006-01-19 at 20:12 +0000, Nick Maclaren wrote:
> Alexander Terekhov <alexander.terekhov at gmail.com> wrote:
> > On 1/19/06, Boehm, Hans <hans.boehm at hp.com> wrote:
> > [...]
> > > But I'm afraid there are many special cases that deserve attention.
> > > Posix/C I/O by default does implicit locking.  (I'm inclined to believe
> > > this was a mistake, but it's not one we can fix.)
> > 
> > Many impls provide __fsetlocking() or alike.
> 
> That doesn't help.  There is no problem with the system calls.
> I didn't realise until Hans posted the above that POSIX had got
> things THAT wrong.  fputc etc. are VERY clearly stated by C to
> be unsafe if used twice between sequence points, and I would have
> thought that anyone would have deduced that they are not going to
> be thread-safe, either.  However, the above does explain why
> modern headers no longer include them as macros.
> 
> I don't suppose that anyone has a reliable list of the function
> calls in C++ that POSIX says are not thread-safe?

In the absence of any pthreads binding for C++, no.  It is *probably*
safe to assume that what's thread-safe in the C libary is still
thread-safe in C++.  There was some discussion about a de facto standard
binding a while back - see
<http://www.codesourcery.com/archives/c++-pthreads/> - but it wasn't
very productive.

Ben.

-- 
Ben Hutchings
Unix is many things to many people,
but it's never been everything to anybody.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://www.decadentplace.org.uk/pipermail/cpp-threads/attachments/20060119/f8686c2d/attachment-0001.pgp


More information about the cpp-threads mailing list