[Win32utils-devel] Fwd: Win32::Daemon, Problems with service_stop

Park Heesob phasis at nownuri.net
Mon Feb 20 09:30:59 EST 2006


On Sun, 19 Feb 2006 17:39:32 -0800 (PST), Daniel Berger wrote
> Anyone want to take a stab at this?  I've brought it
> up before but it's been a while.
> Dan
> Note: forwarded message attached.
As you know,the win32-service is multithreaded application.
But, Ruby's sleep or select is not compatible with the Thread of Windows.
While executing sleep or select in ruby code,the other thread cannot do anything.

To workaround this stopping problem, 

1. Use loop of short sleep insthead of long sleep.
ex) 10.times { sleep 1 } instead of sleep 10

2. Use nonblocking IO and socket.


Park Heesob

More information about the win32utils-devel mailing list