How to implement "More than one user Service may run within the same process"

  • Thread starter Thread starter hagaihe
  • Start date Start date
H

hagaihe

Hello,
I've written a Windows service and i need help to implement the meaning
of the sentence which is generated automatically by the IDE

// More than one user Service may run within the same process. To add
// another service to this process, change the following line to
// create a second service object. For example,
//
// ServicesToRun = new System.ServiceProcess.ServiceBase[] {new
Service1(), new MySecondUserService()};
//

My target is basically to implement survivability of my project so if
the service will "fall down" another process / user will be able to
continue.

Does someone have any idea ??

10x.
 
if your first service blows up due to an unhandled exception, its going to
take your second "service" with it, because the process is going to go away.
Suggest looking into a more robust alternative for whatever it is you want to
accomplish.
Peter
 
Hello, (e-mail address removed)!


[skipped]

h> My target is basically to implement survivability of my project so if
h> the service will "fall down" another process / user will be able to
h> continue.

h> Does someone have any idea ??

You can start several windows services with different names, if one fails another starts operaing
instaed of "dead" one.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
 
Vadym Stetsyak said:
You can start several windows services with different names, if one fails
another starts operaing
instaed of "dead" one.

You can also set the Recovery option for a service to have Windows restart
it automatically if it dies.

-- Alan
 
Please don't push people to start 'shadow' service processes, keep in mind
that services use precious resources not consumed by regular processes.
Better is to look at the option presented by Alan, unfortunately it's not
that easy to achieve from within .NET. Also, services should be as robust as
possible, but <rant>.NET has changed this picture, seems like everyone needs
to write a bunch of services these day's :-). Most of the time they crash or
hang or exhaust precious system resources, but no trouble start another one
when the first fails....</rant>


Willy.

| Hello, (e-mail address removed)!
|
|
| [skipped]
|
| h> My target is basically to implement survivability of my project so if
| h> the service will "fall down" another process / user will be able to
| h> continue.
|
| h> Does someone have any idea ??
|
| You can start several windows services with different names, if one fails
another starts operaing
| instaed of "dead" one.
|
| --
| Regards, Vadym Stetsyak
| www: http://vadmyst.blogspot.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top