From: Yukihiro Matsumoto Date: 2006-02-17T09:39:23+09:00 Subject: Re: Curious interaction between trap and sleep Hi, In message "Re: Curious interaction between trap and sleep" on Fri, 17 Feb 2006 08:58:29 +0900, Eric Jacoboni writes: |Actually, i realize now that it was only a question of timing: in the |C program, SIGCHLD was caught *before* the parent process call |sleep(20): so this sleep was not interrupted. In the Ruby script, a |different timing makes the sleep starting before the child |die... (anyway, that's the conclusion i've reached so far...). This is a intended behavior for C program (sleep(3)) but not for Ruby program, hence it doesn't use sleep(3) and Ruby's sleep method should always sleep for specified duration. So I consider this as a bug in Ruby, and it will be fixed in the next release. Thank you. For a work around, put "Thread.start{sleep}" at the head of your program, #sleep would sleep for specified time amount. matz.