|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Threading using QueueUserWorkItemIam 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 Bharathi kumar wrote: Show quoteHide quote > 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 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. Brian Gideon wrote: Show quoteHide quote > 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 > > Bharathi kumar wrote: > > 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,
I'm glad you figured it out. Brian Bharathi kumar wrote: Show quoteHide quote > 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.
That Eval Question Again...
Simple Eval() (Ithink) question NullReferenceException on DataGridView.Columns Index property Optional Paramter Question ListBox, ComboBox Bug??? Updating Files .NET how to check binary compatability Naming convention of Variables how to devide string to array? Trying to create a copy of a .NET dll |
|||||||||||||||||||||||