C
Coot
I've been running many tests of the Asynchronous Delegate technique
and I find that although BeginInvoke() does queue the method delegate
onto a worker thread, it always does so on the _same_ thread. So if I
call BeginInvoke() three times in a row, the method delegates are
queued to the same thread and the second method doesn't begin until
the first method completes, and the third doesn't begin until the
second completes.
This occurs whether I detect completion through callback,
AsyncWaitHandle, or polling. It occurs no matter whether the delegate
refers to the same instance method or different instance methods.
The bottom line is that I don't get multi-threaded behavior, but only
two-threaded behavior.
I believe this is not the intended behavior. Has anyone else seen
this? Does anyone know why this is happening?
and I find that although BeginInvoke() does queue the method delegate
onto a worker thread, it always does so on the _same_ thread. So if I
call BeginInvoke() three times in a row, the method delegates are
queued to the same thread and the second method doesn't begin until
the first method completes, and the third doesn't begin until the
second completes.
This occurs whether I detect completion through callback,
AsyncWaitHandle, or polling. It occurs no matter whether the delegate
refers to the same instance method or different instance methods.
The bottom line is that I don't get multi-threaded behavior, but only
two-threaded behavior.
I believe this is not the intended behavior. Has anyone else seen
this? Does anyone know why this is happening?