Question How do run processes synchronously from a thread or backgroundworker thread?

Stevejds

New member
Joined
Sep 17, 2007
Messages
1
Programming Experience
10+
How do run processes synchronously from a thread or backgroundworker thread? Is it even possible?

We have program that allows the user to download several files from a remote server, compress them, and then email the files.
It has several long running processes that must run in order. We want these to run on a separate thread so as not to make the form unresponsive. Does a way exist to do this? We attempted a rather clumsy way of approaching this problem by using background worker threads. When each thread is completed and returned back to RunWorkerCompleted, we start another background worker thread and repeat the the next process. It works somewhat but seems to take a lot of resources to run. Does a more elegant/resource friendly way exist to achieve what we are after?
 
Hello.

I'm not quiet sure what you exactly need, your first questions sounds like you're looking for the Invoke() method which all controls have. But the last part made me scratch my head...I'd probably would have done it the same way, using the BGWorker class. The only way I could think of would be to handle the threads yourself. Maybe the resource consumption isn't the BGWorker but the thread itself?

Bobby
 
Back
Top