Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to run Multiple threads
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01213236
Message ID:
01213268
Views:
54
For Gerard's stated requirement, the BackgroundWorker component is in-appropriate. Firstly, it is really targeted for use with forms. Running a couple of loops at the same time doesn't sound like a typical form oriented task.

Also, BackgroundWorker requires at least one event handler to be created and can use upto three. For Gerard's requirement, he wants to run two loops (or more) on separate threads - this would require two BackgroundWorker components, and consequently two "DoWork" event handlers - one to handle each independent loop.

To avoid muddying the waters, he would be better advised to simply create two threads and start them or, use the .NET ThreadPool.

>If you are using .NET 2.0 (or better) you can use the BackgroundWorker component. http://msdn2.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx
>
>This class takes a lot of the work out to working with threads. For a while this was my favorite feature in 2.0.
>
>HTH
>
>>Hi.
>>Anybody know how to run a no. of threads concurrenly (in either c# or c+++
>>e.g.
>>say loop 1 loops arounf displaying 'This is Loop 1'
>>and Loops 2 loops around saying 'This is loop 2'
>>
>>Regards,
>>Gerard
-=Gary
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform