J
Joshua Maurice
Please note: I've added comp.unix.programmer (for the POSIX aspects)
and comp.programming.threads (for the threading aspect)
We've been discussing the next revision of the C standard (C1X)http://en.wikipedia.org/wiki/C1X
Specifically, the inclusion of multi-threading support.
Apparently, Dinkumware's library is being considered, and some
are wondering why the committee did not consider adopting the
POSIX API itself, or a subset thereof.
Would enlightened people in either comp.unix.programmer or
comp.programming.threads comment on these aspects?
Why didn't they adopt the POSIX API itself? I suspect a couple of
reasons.
First compatibility with C++0x. Of course, that begs the question of
why didn't the C, C++, and POSIX committees when working together
decide to adopt the POSIX pthreads standard?
Second, the POSIX pthreads standard is underspecified, and incomplete,
and slightly buggy. It's buggy in the informal simple specification of
try_lock. It's incomplete because it's missing all of the non
sequentially consistent atomics, eg: fences and such. And if you're
going to specify fences portably, you need a rigorously defined memory
model, which C++0x and C1x will give you.
In spirit, C1x and C++0x are compatible in spirit with POSIX pthreads.
They will give you the same primitives with different names, more or
less.
Finally, I suppose you could ask why not fix and extend POSIX
pthreads? They may have been political, see: Windows. Perhaps they
thought they had a better chance to drag Windows kicking and screaming
if they made a new standard?