noreply at rubyforge.org
2007-Dec-27 02:13 UTC
[Win32utils-devel] [ win32utils-Patches-16627 ] Replace inefficient busy wait loop with UDP/IP loopback socket.
Patches item #16627, was opened at 2007-12-26 21:13 You can respond by visiting: rubyforge.org/tracker/?func=detail&atid=413&aid=16627&group_id=85 Category: win32-service Group: Code Cleanup Status: Open Resolution: None Priority: 3 Submitted By: Nobody (None) Assigned to: Nobody (None) Summary: Replace inefficient busy wait loop with UDP/IP loopback socket. Initial Comment: Here are some patches for win32-service which eliminate the messy busy loop that polls the hStopEvent with a zero timeout. Instead of using a Windows event, these patches create a UDP/IP socket bound to the loopback interface which can be used in ruby''s green threads event loop. I believe this is a much cleaner and more efficient mechanism than the WIndows event flag since it allows the ruby thread to block until there''s really a control event from the WIndows service manager. I also include a hCtrlEvent event flag which can be used by ruby win32 services which must wait for control events. This event handle is accessible via the daemon.event_handle method. Note that the hCtrlEvent is not used by the daemon.c logic, it''s merely an event which can be used by the Daemon subclass. ---------------------------------------------------------------------- You can respond by visiting: rubyforge.org/tracker/?func=detail&atid=413&aid=16627&group_id=85