3 ms·
It buys you plenty if you prevent other threads from entering until you all meet in a rendezvous lock.
by djcapelis 12y ago
It buys you plenty if you prevent other threads from entering until you all meet in a rendezvous lock.
- asveikau 12y agoThe worker thread that was kicked off by some random library dependency (acquiring a lock you didn't know about) isn't going to care about your rendezvous lock. Even if you do control all the threads getting them to do what you're suggesting may be nontrivial and costly. Edit: IMO it's better to just admit the programming model is thorny and move on. I feel similarly about signals. Restrict what you do after fork() and generally be cautious, the same way you'd be cautious reacting to a signal.
- djcapelis 12y agoWrap the thread create calls and make them care. :)