Waiting for multiple threads to finish

F

Faraz Hussain

Dear All,
How can I wait for multiple threads to finish in .Net Compact Framework?

In full .Net Framework we have Thread.join() method which we can call to
wait for the thread to finish but in .Net CF it is simply not available. Can
anyone tell me the alternative of Thread.join() method in .Net CF.

I shall be very thankfull.
regards,
Faraz
 
M

Mike

Hi,

you could perhaps get the thread you're wanting to join with to hold a
mutex that it releases just before it completes. You could then wait on
the mutex to be released.

Not particularly elegant, but it should work :)

Mike
 
G

Ginny Caughey [MVP]

Faraz,

You could use a global variable that is incremented as each worker thread
starts and decremented when each thread ends. When it reaches zero, you're
done.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top