Why are the "event" classes in .Net STILL broken?

| 0 Comments

Whilst I'm ranting about the little things...

You still can't create named versions of the .Net ManualResetEvent and AutoResetEvent, even in .Net 2.0. Wasn't everything going to be fixed in Whidbey?

Of course, I realise that you can "simply" access the underlying Win32 API to do it, but a) why should we have to? and b) it's not recommended that you do...

I guess the fact that the P/Invoke route isn't recommended is the reason for the dearth of nicely packaged up solutions to this problem; surely anyone who needs this functionality would write an object that wraps it up nicely rather than doing it "long hand" like this? I particularly like the way that example uses the hole in the encapsulation of ManualResetEvent to replace the event handle so that he can use WaitOne() on it...

Leave a comment