event-wait-handle

How to detect whether an EventWaitHandle is waiting?

I have a fairly well multi-threaded winforms app that employs the EventWaitHandle in a number of places to synchronize access. So I have code similar to this: List<int> _revTypes; EventWaitHandle _ewh = new EventWaitHandle(false, EventResetMode.ManualReset); void StartBackgroundTask() { _ewh.Reset(); Thread t = new Thread(new ...

How should I implement the C# server side portion of long-polling for ajax requests?

I've got an architecture that involves browsers polling via ajax every 3 seconds for updates and I'd like to change that to long-polling. I'd like to have 1, 2.. {n} clients long-polling, waiting for updates and have something happen on the server to signal the waiting clients to return. My first thought was to use an EventWaitHandle, ...