-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 09/29/2011 04:25 PM, Jörg F. Wittenberger wrote:
>> POSIX says that fork needs to produce only a single surviving POSIX >> thread in the child. Perhaps Chicken fork needs to do the same with >> Chicken threads. > > Alaric, that's exactly the effect and reason why I'm using this > disable-interrupts/enable-interrupts around fork: to make sure > there is only this one Chicken-threads running in the child. > With interrupts disabled there is no scheduling in chicken. > (At least not until you run into a thread-yield! anyway.) > > And therefore I'd really recommend to keep it in the runtime. I think a better mechanism would be a way to abort all threads but the current one, triggered after the fork in the child, with no interrupts until the thread murder is complete. If you just go off and exec after the fork it'd be better to uninterruptably vfork-then-exec, but we have procedures to do that already! Aborting all threads but the one that asked for the fork also gives one the opportunity to inform them of this fact, should any of them leave useful data structures in incosistent states with locks held. There's something to be said for requesting permission to fork from all threads before doing so, so they can make sure they finish any operations on shared state in the parent, but that'll be complex, and a potential performance bottleneck, so probably not worth it! ABS - -- Alaric Snell-Pym http://www.snell-pym.org.uk/alaric/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk6EkCcACgkQRgz/WHNxCGoBNwCfS5syjjCVWFiyjcP0S6z/BFoB s6MAnjE+v+0Tf32+9bQ+X6wd6UgEA+pA =fjVS -----END PGP SIGNATURE----- _______________________________________________ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users