Live data from Hacker News

C Finally Gets A New Standard

drdobbs.com

1–10 of 73 posts

Re: C Finally Gets A New Standard

#3
post #2

I see they made the same mistake as POSIX threads in implementing recursive mutexes. Disheartening.

Of all the ways to shoot yourself in the foot with C, recursive mutexes seem relatively benign. The implementation is a handful of lines of code, and they're not always a symptom of bad design, either; imagine needing to lock each node in a path through a (possibly cyclic) graph.

Re: C Finally Gets A New Standard

#7
It seems to me if ANY one group of people should be allowed to add new keywords to the user namespace, it should be the standard bearers. The whole _Keyword thing is something only a committee could love.

Re: C Finally Gets A New Standard

#8
post #3
post #2

I see they made the same mistake as POSIX threads in implementing recursive mutexes. Disheartening.

Of all the ways to shoot yourself in the foot with C, recursive mutexes seem relatively benign. The implementation is a handful of lines of code, and they're not always a symptom of bad design, either; imagine needing to lock each node in a path through a (possibly cyclic) graph.

If two different threads were trying to lock different paths that entered the same cycle at different nodes, there can be a deadlock.

  X -> B
  B -> C
  C -> B
  Y -> C
Thread 1 tries to lock X B C; thread 2 tries to lock Y C B; deadlock with 1 holding X and B, 2 holding Y and C.

It's possible that your paths may be more restricted than this, but I reckon keeping the paths and cycles clean would be a bigger problem than recursive mutexes.

Re: C Finally Gets A New Standard

#10
post #4

1990 C90 2000 C99 2011 C11 so, if this is the trend expect a new C standard in 2022.

True, but new standards don't mean that they get support in all compilers.

http://en.wikipedia.org/wiki/C99 http://en.wikipedia.org/wiki/C11_%28C_standard_revision%29

Microsoft as typical bad boy attitude already said it only cares about C89, as everything else can be done with C++ anyway.

And as they don't care about portability this is unlikely to change, unless they are pressured to change like it happened with IE.

Post reply on HN