[cpp-threads] Editorial comments on the straw man
Nick Maclaren
nmm1 at cus.cam.ac.uk
Thu Jan 19 20:12:02 GMT 2006
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?
Regards,
Nick Maclaren,
University of Cambridge Computing Service,
New Museums Site, Pembroke Street, Cambridge CB2 3QH, England.
Email: nmm1 at cam.ac.uk
Tel.: +44 1223 334761 Fax: +44 1223 334679
More information about the cpp-threads
mailing list