[Win32utils-devel] win32-service patch
djberg96 at gmail.com
Mon Jun 19 21:34:13 EDT 2006
Heesob Park wrote:
> 2006/6/20, Patrick Hurley <phurley at gmail.com>:
>> Attached is a patch and my service.c if there is any difficulty
>> applying the patch. I did the following:
>> 1. Created a ruby thread (Ruby_Service_Ctrl), that polls against a
>> simple integer value (protected by a critical section). I was worried
>> this would be "expensive"; however, I found the rb_thread_polling
>> method and it seems to work well.
>> 2. When an event occurs in Service_Ctrl it sets the flag value.
>> 3. If Ruby_Service_Ctrl finds an entry in the call back hash it
>> invokes it (in its own thread) and goes back to polling
>> 4. On a SERVICE_CONTROL_STOP the Ruby_Service_Ctrl, processes normally
>> and then begins to exit, but it first waits for all previously spun
>> threads to return.
>> 5. Service_Ctrl on a stop waits for Ruby_Service_Ctrl to indicate that
>> all threads are stopped before stopping the service (it continues to
>> update service status politley).
>> That's it -- in my tests it works perfectly. If I made any fax paus in
>> my patch creation or summary please let me know.
>> Thanks again
> That is a really good pacth!
> I confirmed the patch works perfectly.
> Park Heesob
> win32utils-devel mailing list
> win32utils-devel at rubyforge.org
Cool. The mission of the people on this list, should you choose to
accept it, is to try your best to break it.
I'd also like to get some feedback from the Mongrel folks (Luis?), since
they seem to be one of the major users/stress testers.
More information about the win32utils-devel