Jump to content

Number of Threads are more when running Windows Service.


Recommended Posts

Guest sanjay pakale
Posted

Hi all,

I am working on Windows service. I have created 2 worker Threads which will get initiated in OnStart method of the Windows service. The service has handled few events Timer Elapsed, NetWorkChanged, OnPowerEvent & it has OnCustomCommand method implemented. All these events and methods are talking with driver. These all events and methods can execute at same time and driver handles one request at a time. There is a chance of occurring a Race condition.

My question are:

1. when my service starts running I could see there were around 15 threads running(Task Manager Thread number). From where 15 Threads came into my application even though I have created only 2 worker thread and one Main Thread

2. So there are multiple events and override methods are implemented and there is a chance of Race condition, so how to this situation?

Please help me to resolve this issue.

Thanks,

Sanjay

 

Continue reading...

  • Replies 0
  • Created
  • Last Reply

Popular Days

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...