6

Maybe I am misunderstanding the use of the P99 library but what advantages does it provide over C11 (mainly concerned about multithreading) if anything more than being an emulator.

Speed? Efficiency?

Or just backwards compat?

Keith Thompson
  • 254,901
  • 44
  • 429
  • 631
BAR
  • 15,909
  • 27
  • 97
  • 185
  • 13
    C11 compilers (plus libraries) just simply don't exist, yet. P99 for its emulation of C11 interfaces allows you to use these interfaces now. – Jens Gustedt Jul 07 '12 at 23:23
  • @JensGustedt 2021, 10 years after C11 and there's still major C11 incompatibility. Sometimes I wonder why we even try with new standards. If it ain't here in 10 years, it may never be. – user426 Oct 18 '21 at 08:34
  • @user426, I am not sure to what incompatibility you are refereing. There are still compilers out there that don't even do C99, that's true. – Jens Gustedt Oct 19 '21 at 09:05
  • @JensGustedt MSVC , the usual culprit. They support "all the mandatory bits of C11/17" but guess the committee decided it was cool to leave out atomics and threading among other things that shouldn't have been. But then again, Microsoft has say in the committee (anyone can buy say now), doesn't it. It's been like this for all standards after the golden C99 - too many things are optional for claiming conformance. PS: Honoured to speak to a modern committee member ! – user426 Oct 19 '21 at 10:59
  • @user426 I actually am quite happy that they fell in line, at least for the mandatory. Others do similar, e.g IBM on their mainframes. And for the influence of MS in WG14, you seem to live in a different world that I am. Since I am particpating in the meetings (2015 or so) I have not seen any of them participating and I can ensure you that they don't have any influence whatsoever. And nobody thinks that making atomics or threads optional is "cool". We have the imperative of making C available to a very large spectrum of architectures, these are the kind of compromises that it takes. – Jens Gustedt Oct 20 '21 at 09:27
  • @JensGustedt Threading should have been trivially pthreads compatible (*why reinvent the wheel ?*). Pthreads is more portable than `threads.h`, even to Windows devices and IBM Mainframes AFAIK. I was happy to find a post about this on your blog, but nothing seems to have happened, and correcting `threads.h` doesn't seem to be a topic of much discussion for C23. `stdatomic.h`, can be made mandatory. C++ has made it so even for freestanding, and as multithreading was copied from C++, how was this overlooked ? What parallel hw has no atomics and why does it deserve to claim conformance ? – user426 Oct 21 '21 at 03:49
  • @user426, please stop this. Comments on a 9 year old SO question are not an appropriate place to continue a discussion about what and why C threads are different from POSIX threads. – Jens Gustedt Oct 22 '21 at 07:22
  • @JensGustedt Fair enough. Where may I continue the discussion ? – user426 Oct 23 '21 at 07:32

1 Answers1

5

The main advantage it provides over C11 is that it works with C99 compilers. C11 support doesn't really exist yet. It also provides many features that aren't in C11.

Jason
  • 1,059
  • 9
  • 13