471,306 Members | 1,305 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,306 software developers and data experts.

windows service questions

ZQ
Hi all!

I have few questions regarding .net windows services

1. are onStart, onStop and other "system" events invoked in separate threads
than msmq events?
2. if so, is there a way for the onStop event to wait with stopping the
service until pending msmq events are finished?
3. if not, does that mean that the onStop event would actually be invoked
after all pending events are finished?

thanks!

Z.
Feb 8 '06 #1
4 2019
Services and MSMQ (which is also a service) have nothing to do with each
other, unless you tell them to. Every service runs in its own process. The
Starting and Stopping of services is not a concern of MSMQ. MSMQ is a
messenger. It queues messages, and delivers them when it can. If a service
stops, and then starts later, the message will still be there.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
We got a sick zebra a hat,
you ultimate tuna.
"ZQ" <zv*****@yahoo.com> wrote in message
news:uG**************@TK2MSFTNGP14.phx.gbl...
Hi all!

I have few questions regarding .net windows services

1. are onStart, onStop and other "system" events invoked in separate
threads than msmq events?
2. if so, is there a way for the onStop event to wait with stopping the
service until pending msmq events are finished?
3. if not, does that mean that the onStop event would actually be invoked
after all pending events are finished?

thanks!

Z.

Feb 8 '06 #2
ZQ
Ok. Thanx for your quick response.
However.

In my win. service, I have configured it to asynchronously fire up an event
every time a message arrives into a message queue. Once it fires, I
endreceive the
message (and deserialize it), and process the received object. The
processing
takes awhile, and my real question is - if an administrator stops the
service while
the service is processing the message, will it kill the thread in which it
processes the message?

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:u%****************@TK2MSFTNGP09.phx.gbl...
Services and MSMQ (which is also a service) have nothing to do with each
other, unless you tell them to. Every service runs in its own process. The
Starting and Stopping of services is not a concern of MSMQ. MSMQ is a
messenger. It queues messages, and delivers them when it can. If a service
stops, and then starts later, the message will still be there.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
We got a sick zebra a hat,
you ultimate tuna.
"ZQ" <zv*****@yahoo.com> wrote in message
news:uG**************@TK2MSFTNGP14.phx.gbl...
Hi all!

I have few questions regarding .net windows services

1. are onStart, onStop and other "system" events invoked in separate
threads than msmq events?
2. if so, is there a way for the onStop event to wait with stopping the
service until pending msmq events are finished?
3. if not, does that mean that the onStop event would actually be invoked
after all pending events are finished?

thanks!

Z.


Feb 9 '06 #3
> if an administrator stops the service while
the service is processing the message, will it kill the thread in which it
processes the message?
Not necessarily. The Stop event sends a message to the service application
to stop. It doesn't kill the thread. That's why there's an event handler
there. But make sure that you account for the Stop event, and don't take too
long to finish up. Then you'll be just fine.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
We got a sick zebra a hat,
you ultimate tuna.
"ZQ" <zv*****@yahoo.com> wrote in message
news:Oy**************@TK2MSFTNGP12.phx.gbl... Ok. Thanx for your quick response.
However.

In my win. service, I have configured it to asynchronously fire up an
event
every time a message arrives into a message queue. Once it fires, I
endreceive the
message (and deserialize it), and process the received object. The
processing
takes awhile, and my real question is - if an administrator stops the
service while
the service is processing the message, will it kill the thread in which it
processes the message?

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:u%****************@TK2MSFTNGP09.phx.gbl...
Services and MSMQ (which is also a service) have nothing to do with each
other, unless you tell them to. Every service runs in its own process.
The Starting and Stopping of services is not a concern of MSMQ. MSMQ is a
messenger. It queues messages, and delivers them when it can. If a
service stops, and then starts later, the message will still be there.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
We got a sick zebra a hat,
you ultimate tuna.
"ZQ" <zv*****@yahoo.com> wrote in message
news:uG**************@TK2MSFTNGP14.phx.gbl...
Hi all!

I have few questions regarding .net windows services

1. are onStart, onStop and other "system" events invoked in separate
threads than msmq events?
2. if so, is there a way for the onStop event to wait with stopping the
service until pending msmq events are finished?
3. if not, does that mean that the onStop event would actually be
invoked after all pending events are finished?

thanks!

Z.



Feb 9 '06 #4
ZQ

That's the info I needed.
Thanks, Kevin
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:On**************@TK2MSFTNGP09.phx.gbl...
if an administrator stops the service while
the service is processing the message, will it kill the thread in which
it processes the message?


Not necessarily. The Stop event sends a message to the service application
to stop. It doesn't kill the thread. That's why there's an event handler
there. But make sure that you account for the Stop event, and don't take
too long to finish up. Then you'll be just fine.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
We got a sick zebra a hat,
you ultimate tuna.
"ZQ" <zv*****@yahoo.com> wrote in message
news:Oy**************@TK2MSFTNGP12.phx.gbl...
Ok. Thanx for your quick response.
However.

In my win. service, I have configured it to asynchronously fire up an
event
every time a message arrives into a message queue. Once it fires, I
endreceive the
message (and deserialize it), and process the received object. The
processing
takes awhile, and my real question is - if an administrator stops the
service while
the service is processing the message, will it kill the thread in which
it processes the message?

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:u%****************@TK2MSFTNGP09.phx.gbl...
Services and MSMQ (which is also a service) have nothing to do with each
other, unless you tell them to. Every service runs in its own process.
The Starting and Stopping of services is not a concern of MSMQ. MSMQ is
a messenger. It queues messages, and delivers them when it can. If a
service stops, and then starts later, the message will still be there.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
We got a sick zebra a hat,
you ultimate tuna.
"ZQ" <zv*****@yahoo.com> wrote in message
news:uG**************@TK2MSFTNGP14.phx.gbl...
Hi all!

I have few questions regarding .net windows services

1. are onStart, onStop and other "system" events invoked in separate
threads than msmq events?
2. if so, is there a way for the onStop event to wait with stopping the
service until pending msmq events are finished?
3. if not, does that mean that the onStop event would actually be
invoked after all pending events are finished?

thanks!

Z.



Feb 10 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Bill Sonia | last post: by
4 posts views Thread by Kris | last post: by
4 posts views Thread by Water Cooler v2 | last post: by
2 posts views Thread by shapper | last post: by
6 posts views Thread by Chris Marsh | last post: by
5 posts views Thread by dm3281 | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.