On Tue, Sep 30, 2008 at 7:59 PM, Jacob <> wrote:
> I have googled, and I found a method call 'timeout', but after read
> the source code, I found it uses a new thread to handle timeout. I
> think It's not good solution, because on my real system (ported
> from .net source code), there are some thread running parallel, and
> there are using alot of signal.
You will have to code carefully because ruby uses green threads, not
native threads so you can get blocked on system calls.
I had the same sort of problem, in the end, we solved it with the
terminator gem (1)
See the system timer (2) write up for a good explanation of what is happening.
1)
http://www.lindsaar.net/2008/9/11/te...-without-mercy
2)
http://ph7spot.com/articles/system_timer
Mikel
--
http://lindsaar.net/
Rails, RSpec and Life blog....