J
Joris Dobbelsteen
Is it correct that the AutoResetEvent class doesn't guareentee any ordering?
- Joris
- Joris
Nicholas Paldino said:Joris,
Yes, this is correct. The order in which the threads are released is
not able to be set, or guaranteed.
You should use this as a filter of sorts, not as an ordering mechanism.
If you need an ordering mechanism, then you should have a controller on a
thread which will block the other threads (it passes out the handles to wait
on, so that they are unique), and then have that wait on the one event.
When it is released, it releases one more thread.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Joris Dobbelsteen said:Is it correct that the AutoResetEvent class doesn't guareentee any ordering?
- Joris
Joris Dobbelsteen said:Too bad, I basically because a problem because a few threads continues get
the event and the other ones are waiting till they time out...
I would expect that muxes will work the same.
Is there a limitation to the number of WaitHandles that can be created under
.NET? Or perhaps a very long setup time?
- Joris
message news:#f#vR#[email protected]...Joris,
Yes, this is correct. The order in which the threads are released is
not able to be set, or guaranteed.
You should use this as a filter of sorts, not as an ordering mechanism.
If you need an ordering mechanism, then you should have a controller on a
thread which will block the other threads (it passes out the handles to wait
on, so that they are unique), and then have that wait on the one event.
When it is released, it releases one more thread.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Joris Dobbelsteen said:Is it correct that the AutoResetEvent class doesn't guareentee any ordering?
- Joris
Nicholas Paldino said:Joris,
I imagine that the upper limit on these things is very high. Just how
many are you planning on creating?
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
onJoris Dobbelsteen said:Too bad, I basically because a problem because a few threads continues get
the event and the other ones are waiting till they time out...
I would expect that muxes will work the same.
Is there a limitation to the number of WaitHandles that can be created under
.NET? Or perhaps a very long setup time?
- Joris
message news:#f#vR#[email protected]...atothread which will block the other threads (it passes out the handles
waiton, so that they are unique), and then have that wait on the one event.
When it is released, it releases one more thread.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
message Is it correct that the AutoResetEvent class doesn't guareentee any
ordering?
- Joris