Re: Official Linux system wrapper library?

From: Adam Borowski
Date: Wed Nov 14 2018 - 07:03:56 EST


On Sun, Nov 11, 2018 at 12:46:35PM +0100, Florian Weimer wrote:
> A lot of multi-threaded applications assume that most high-level
> functionality remains usable even after fork in a multi-threaded
> process.

How would this be even possible? Currently fork kills all threads
(save for the caller).

Glibc's manpage also warns:

# After a fork() in a multithreaded program, the child can safely call only
# async-signal-safe functions (see signal-safety(7)) until such time as it
# calls execve(2).

Which makes sense as its malloc uses a mutex, and you can't take a breath
without a library call using malloc somewhere (or in C++, the language
itself).

So any functionality remaining usable after fork is pretty strictly
limited...


Meow!
--
âââââââ I've read an article about how lively happy music boosts
âââââââ productivity. You can read it, too, you just need the
âââââââ right music while doing so. I recommend Skepticism
âââââââ (funeral doom metal).