Help with porting thread functionality: Win32 --> .Net

Posted by JimDaniel on Stack Overflow See other posts from Stack Overflow or by JimDaniel
Published on 2010-05-20T16:34:26Z Indexed on 2010/05/20 16:40 UTC
Read the original article Hit count: 225

Filed under:
|
|
|

Hi, I am responsible for porting a class from legacy Win32 code to .Net and I have come across a threading model that I'm not sure how best to implement in .Net. Basically the Win32 has one worker thread, which calls WaitForMultipleObjects() and executes the particular piece of code when a particular object has been triggered. This has a sort of first-come-first-serve effect that I need to emulate in my own code. But I'm not sure how best to do this in .Net. Does anyone have any idea?

I see that there is no equivalent of WaitForMultipleObjects() in .Net, only the ThreadPool class, which seems to provide most of what I need, but I'm not sure if it's the best, since I only have four objects total to wait and execute code for.

Thanks, Daniel

© Stack Overflow or respective owner

Related posts about .NET

Related posts about thread