[Win32utils-devel] win32/service... still with problems.
luislavena at gmail.com
Mon May 22 16:32:26 EDT 2006
On 5/22/06, Berger, Daniel <Daniel.Berger at qwest.com> wrote:
> > Daniel, you tried more than 1 start/stop cycles?
> Yes. I ran a series of start/stops as fast as my little fingers would
> let me. No problem.
Me too, I though was my pc, so dumped my p3 800mhz 512mb for a p4,
3.0ghz, 1gb... same results.
> > In the first run, everything worked ok, but several tries
> > after it, showed that it works "sometimes" and other don't.
> > (no matter if you left the service running for 1 second or 10 minutes)
> When you say it didn't work, do you mean that the the service_main or
> service_stop hooks weren't called? Or some other error?
the service_stop hook is called, but the code in there is no executed,
to the point the service stop responding and service manager report it
that the pipe has ended or an exception ocurred.
> > If you see the attached version, service_stop will try to
> > raise the Interrupt exception so the runner thread gets terminated.
> Ok, I see the same behavior you mention - the service_stop handler
> doesn't get executed for some reason. I think we're back to the thread
> issues that Heesob mentioned in a previous post about this.
> Heesob, care to weigh in?
I didn't get the Heesob reply about this, maybe thats why I keep
asking the same :-P
On my freebasic (please, don't think freebasic as old basica, is more
powerful than that, closer to c, but with basic syntax).
Anyway, on my framework, I solved this problem executing my Main
function (which will be service_main in the ruby side) in another
thread and wait for it to terminate until I destroy the events.
Also, wouldn't be more correct report to the service manager that
SERVICE_STOP_PENDING (is stopping) before calling service_stop? in
service.c:78-83 thre is executed from EventHookHash prior reporting
the Service Manager that we received the stop signal and we are
In service.c:114, dwControlCode is evaluated after setting the
ServiceState, and if it was CONTROL_STOP, we set the Stop event,
something that exit service_main prematurely.
I don't think service.c could be implemented as pure ruby (due
required native threads)... or not?
Please excuse my english (again), I try to explain better I could, but
is not easy due: complexity of the topic, and the self-learned nature
of the language.
Leaders are made, they are not born. They are made by hard effort,
which is the price which all of us must pay to achieve any goal that
More information about the win32utils-devel