Is it possible to create service that uses main loop only!

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hello

I have been assigned a task of creating a windows service application. I did some reading and wrote a sample application. The application is simple console program that launches thread that handles the actual service work.
When I receive request from the service manager to stop the service I send message to my thread telling it to stop. When thread is stopped I exit the service main function and that is it.


Is this the simplest way to implement the service. I mean, is it possible to implement the service without the second thread?

si
.



Relevant Pages

  • Re: Any good links on how to thing when designing windows services
    ... The whole concept of a windows service is that it start with the OS - ... happend /yet/ - havent used eventlogger in my VB6 service, ... return value from the reading of RFID, ... so I put in a sleep in the main while loop just to be safe.. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Windows Service in C#
    ... Thank you for your response, I found out the cause that generated that ... behaviour of the windows service. ... The cause was that I was reading from the file too quickly after the ... I don't understand the reason for this. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: RegQueryValueEx problem?
    ... What is the reason RegQueryValueEx function not work to reading a process ... Can Windows Service start a process to the user account (now process is to ...
    (microsoft.public.win32.programmer.kernel)
  • Re: VB 6 app calling C# windows service
    ... But I think you should be more specific, such as: how do you communicate? ... Reading you I guess you simply have multithreading error, ... > Has anyone written a windows service in C# that used multiple threads, ...
    (microsoft.public.dotnet.framework)
  • http request from windows service
    ... What security issues shall I care about when sending http requests from a ... I have a console program that works fine if I start it from ... I am using HttpWebRequest and HttpWebResponse classes. ...
    (microsoft.public.dotnet.security)