News for hackers. Stuff that matters.
Re:Libdill: Structured Concurrency for C (2016) by pkhuong on Tuesday June 01, 2021 @06:11PM (#27362102)
From the same paragraph: "there are still some (http://concurrencykit.org/) good (https://software.intel.com/content/www/us/en/develop/documen...) options (https://github.com/facebook/folly/tree/master/folly/concurre...) out there."

There are plenty of practical solutions to the safe memory reclamation problem in C. The language just doesn't force one on you.

From epoch-based reclamation (https://github.com/concurrencykit/ck/blob/master/include/ck_..., especially with the multiplexing extension to Fraser's classic scheme), to quiescence schemes (https://liburcu.org/), or hazard pointers (https://github.com/facebook/folly/blob/master/folly/synchron..., or https://pvk.ca/Blog/2020/07/07/flatter-wait-free-hazard-poin...)... or even simple using a type-stable (https://www.usenix.org/legacy/publications/library/proceedin...) memory allocator.

In my experience, it's easier to write code that is resilient to hiccups in C than in Java. Solving SMR with GC only offers something close to lock-freedom when you can guarantee global GC pauses are short enough... and common techniques to bound pauses, like explicitly managed object pools, land you back in the same problem space as C.

Re:Libdill: Structured Concurrency for C (2016) by bullen on Wednesday June 02, 2021 @02:08AM (#27365438)
Maybe, but Java is the most successful server side language because it has other features that C lacks and will always lack, the most important being: it does not seg. fault on you!

It gives you a stack trace that helps you debug in seconds and when that is not enough a heap dump gives you enough information to solve the problem of a live service without having it down.

To use any other language for servers is madness. For clients I prefer C (with a tad of C++ for convenience like namespaces, string and streams).

I even hot-deploy to it with .dll/.so like I hot-deploy the classloader to Java for development speed!

Another quote you'll try to deconstruct but I know it to be true because I use it every day:

"While I'm on the topic of concurrency I should mention my far too brief chat with Doug Lea. He commented that multi-threaded Java these days far outperforms C, due to the memory management and a garbage collector. If I recall correctly he said "only 12 times faster than C means you haven't started optimizing"." - Martin Fowler https://martinfowler.com/bliki/OOPSLA2005.html

Re:Libdill: Structured Concurrency for C (2016) by ankurdhama on Wednesday June 02, 2021 @05:15AM (#27366565)
You can get stack trace on segfault in C. Stackoverflow reference: https://stackoverflow.com/questions/77005/how-to-automatical...
Re:Libdill: Structured Concurrency for C (2016) by bullen on Wednesday June 02, 2021 @09:54AM (#27368697)
Not without a crash!

And you need debug which is slower!