HElp needed to create a windows service , to launch a simple thread(win32)
HElp needed to create a windows service , to launch a simple thread created by the user.
I got an article here...
But how to create a thread at apropriate places , like STOP , RESUME , SHUTDOWN?.PLease
give me some pointers ,
thanks in advance...
Re: HElp needed to create a windows service , to launch a simple thread(win32)
It really depends on the nature of your service. Typically a service should spend most of its time waiting for some sort of event. Your main thread should be in some sort of loop that polls for some sort of event, and if nothing is going on, it sleeps for some amount of time, then polls again. While in this loop of polling, you can check for mutexes (mutices?) or semaphores which can be set as a result of STOP, RESUME, or PAUSE with WaitForSingleEvent() or WaitForMultipleEvents() API calls.
|All times are GMT +5.5. The time now is 01:49.|