On Sep 29 2011, Alaric Snell-Pym wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/29/2011 02:43 PM, Jörg F. Wittenberger wrote:

(define (chicken-enable-interrupts!) (set! C_interrupts_enabled #t))
(define chicken-disable-interrupts! (foreign-lambda void
"C_disable_interrupts"))

(let ((pid (begin
 (chicken-disable-interrupts!)
 ((foreign-lambda int "fork")) ))
(if (not (= pid 0)) (chicken-enable-interrupts!))
...
)
...
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.




_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to