|
From: | Jörg F . Wittenberger |
Subject: | Re: [Chicken-users] remove enable/disable interrupt flag |
Date: | 29 Sep 2011 17:25:33 +0200 |
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.
[Prev in Thread] | Current Thread | [Next in Thread] |