|
From: | Maxime Devos |
Subject: | bug#56674: [Shepherd] Use of ‘waitpid’, ‘system*’, etc. in service code can cause deadlocks |
Date: | Sat, 13 Aug 2022 16:59:55 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 |
Alternatively: 4. Do the waitpid in a separate thread (needs work-around for the multi-threaded fork problem, probably C things? Or modifying Guile and maybe glibc to avoid async-unsafe things or make more things async-safe or whatever the appropriate ...-safe is here.)For shepherd, multithreading is not an option due to the semantics of fork in the presence of threads.
From what I've read, multi-threaded fork is safe as long as you do an exec 'immediately' afterwards, without doing things like taking locks or allocating memory with malloc in-between the fork and exec. I don't think it's possible to do that in Guile code, but that's what the C things are for.
Greetings,
OpenPGP_0x49E3EE22191725EE.asc
Description: OpenPGP public key
OpenPGP_signature
Description: OpenPGP digital signature
[Prev in Thread] | Current Thread | [Next in Thread] |