Multithreading ?

MaxinA

Member
Joined
May 11, 2007
Messages
15
Location
Canada
Programming Experience
10+
I have a demo project that is coded in VB.NET 2005

I need to be able to maintain a collection of objects, each of which spawn a thread in which to perform a long painful scanning function. If the thread finds a "hit" then it needs to signal the main thread that this event has occured. Also, if the thread encounters an error, it needs to also signal the main thread. The point of it all is that the callbacks from the individual objects pass their notifications to the main thread.

I have a demo project that approximates my needs. The demo project needs to be modified to accomplish this.

I have asked for help before, but I have tried about 5 times now to pull this off, and cannot seem to apply the examples given.

Please Help!

Thanks Muchly

Andrew
 

Attachments

  • Demo.zip
    17 KB · Views: 19
Last edited by a moderator:
Just use a BackgroundWorker in your worker class, set it to reports progress and support cancellation, do the work in DoWork event handler, the ProgressChanged and RunWorkerCompleted events are safe so you can raise your events there.
 
Back
Top