News for hackers. Stuff that matters.
Re:Unlocking Python's Cores:Energy Implications of Removing ... by philsnow on Monday March 09, 2026 @01:26PM (#47312175)
Fork-then-thread works, does it not?
Re:Unlocking Python's Cores:Energy Implications of Removing ... by kccqzy on Monday March 09, 2026 @01:40PM (#47312431)
If you have enough discipline to make sure you only create threads after all the forking is done, then sure. But having such discipline is harder than just forbidding fork or forbidding threads in your program. It turns a careful analysis of timing and causality into just banning a few functions.
Re:Unlocking Python's Cores:Energy Implications of Removing ... by josefx on Monday March 09, 2026 @04:40PM (#47315184)
Can't you check what threads are active at the time you fork?
Re:Unlocking Python's Cores:Energy Implications of Removing ... by kccqzy on Monday March 09, 2026 @06:30PM (#47316608)
And what do you do with that information? Refuse to fork after you detect more than one thread running? I haven’t seen any code that gracefully handles the unable-to-fork scenario. When people write fork-based code, especially in Python, they always expect forking to succeed.
Re:Unlocking Python's Cores:Energy Implications of Removing ... by rpcope1 on Monday March 09, 2026 @01:30PM (#47312265)
But not the reverse, if its a bare fork and not strictly using basically mutex and shared resource free code (which is hard), and there's little or no warning lights to indicate that this is a terrible idea that fails in really unpredictable and hard to debug ways.