Ufit said:
------------------- 8< ~~~~~~~~~
What is the advantage of using windows service instead a regular win. application?
Services are running (assuming they're set to start automatically) from
the moment the machine starts until it shuts down. A windows app will
only run once someone logs on (if it's in the startup menu), and will
stop running when that person logs out. Or if you're using TS/Fast User
Switching, you might have multiple copies of your windows app trying to
run.
Are there any performance issues? My thread will have a lot of workload - a big lot.
I don't even know the physical limits on PC for number of concurent threads.
The Windows Service can be convenient but rough to handle and debug.
My normal way of developing services is to write a class library that
has a class that defines Start/Stop/Pause/Continue/Shutdown functions.
My Service exe is just a thin wrapper around this class library. But I
also have a windows forms application that has buttons that link to
these functions - so when I'm debugging, I use the windows application
to simulate running the service, and then I just deploy the service exe
and the class library into production.
The only problem I've encountered with the above method of debugging
services is that most of the services I've written are intended to run
under LocalService or NetworkService, so debugging it through windows
forms (where it's running under my account) can lead to me missing some
permissions issues.
If you're looking to debug behaviour that isn't part of the
startup/shutdown of the service, but is instead part of the normal
operation of the service, then you can always start a debug build of
the service normally and then attach the debugger to it, before doing
whatever it is that triggers behaviour in your service (e.g. a remoting
call, a MSMQ message arriving, etc)
Damien