sebadinoist
New member
- Joined
- Jan 7, 2009
- Messages
- 2
- Programming Experience
- 5-10
Hello,
I have been using threads in windows services for a while, and have noticed (through usage and viewing other people's code) that there are different ways of launching new threads. Could anyone explain the difference in creating new threads in the following ways:
1)
ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf myObj.mySub))
2)
myThread = New Thread(AddressOf myObj.mySub)
myThread.Start()
I am most interested in whether there is any performance advantage of either way. For the purposes of this, assume that I am running the service on a dedicated windows server 2008 with several threads running at the same time.
I have been using threads in windows services for a while, and have noticed (through usage and viewing other people's code) that there are different ways of launching new threads. Could anyone explain the difference in creating new threads in the following ways:
1)
ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf myObj.mySub))
2)
myThread = New Thread(AddressOf myObj.mySub)
myThread.Start()
I am most interested in whether there is any performance advantage of either way. For the purposes of this, assume that I am running the service on a dedicated windows server 2008 with several threads running at the same time.