Threading using QueueUserWorkItem

  • Thread starter Thread starter Bharathi kumar
  • Start date Start date
B

Bharathi kumar

Hi,

Iam working in windows appln using .NET framework 2.0.


My application is having several threads running.


All threads can call a common method.


I have following code in my common method.
Threading.ThreadPool.QueueUserWorkItem(New Threading.WaitCallback(

_
AddressOf MyFunction))


When I call the common method, its executing "MyFunction" twice.


I want the "MyFunction" to execute only once.


Any suggestions please.


Regards,
Bharathi Kumar
 
Bharathi,

That's certainly not what's suppose to happen. I think you'll have to
provide a short, but complete program that demonstrates the problem.

Brian
 
Hi,

Iam sorry. Its working fine.

One of my colleague had modified the code. They have added one more
thread thats calling "MyFunction".

So "MyFunction" had called twice.

I didn't notice that code and thought the behaviour was peculiar.

Thank you very much,
Regards,
Bharathi Kumar.
 
Back
Top