returning values from a thread
C#
3
Posts
3
Posters
0
Views
1
Watching
-
hi, anybody has some sample code about how to return a value from a thread, lets say I have a couple of threads running, and I want to return the value of a calculation that its done in the thread, how can achieve this thanks in advance
-
hi, anybody has some sample code about how to return a value from a thread, lets say I have a couple of threads running, and I want to return the value of a calculation that its done in the thread, how can achieve this thanks in advance
The ThreadStart delegate returns void, so you can't return anything. Look for the BeginInvoke/EndInvoke methods, they allow you to return a value. Or you can use a shared variable to do the job. Regards Senthil