WaitForMultipleObjects equivalent in .Net?

  • Thread starter Madhu Gopinathan
  • Start date
M

Madhu Gopinathan

Hi,
I need to implement my own ThreadPool class because I want to have
control over the threads and their lifetimes. The ThreadPool class will take
care of thread recovery in case threads lock up and the implementation
provided by .Net does not provide for the same.

My question now is that enqueing of jobs into my threadpool requires me
to wait for an available thread or a stop processing signal (which is
handled by a ManualResetEvent). What I now require is a
WaitForMultipleObjects kind of .Net call that will allow me to wait on the
executing threads or the ManualResetEvent to take further action.

Is there such a system call available in .Net (in .Net 1.1 or 2.0) ? Is
there any way I can simulate such an activity?

Thanks in advance,
Madhu
 
R

Richard Blewett [DevelopMentor]

WaitHandle.WaitAll or WaitHandle.WaitAny

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

Hi,
I need to implement my own ThreadPool class because I want to have
control over the threads and their lifetimes. The ThreadPool class will take
care of thread recovery in case threads lock up and the implementation
provided by .Net does not provide for the same.

My question now is that enqueing of jobs into my threadpool requires me
to wait for an available thread or a stop processing signal (which is
handled by a ManualResetEvent). What I now require is a
WaitForMultipleObjects kind of .Net call that will allow me to wait on the
executing threads or the ManualResetEvent to take further action.

Is there such a system call available in .Net (in .Net 1.1 or 2.0) ? Is
there any way I can simulate such an activity?

Thanks in advance,
Madhu
 

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