473,378 Members | 1,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

release all waiting threads in .NET?

Hello,
I need to use the functionality of an AutoResetEvent in that it should
normally be non-signalled, but I want something to be able to release all the
waiting threads when I call Set, however AutoResetEvent.Set only releases one
thread.
ManualResetEvent isn't really appropriate because it should remain
non-signalled, i.e. when any thread calls WaitOne() it always needs to block
until 'nudged'.
Is ManualResetEvent.Set() immediately followed by ManaulResetEvent.Reset()
the only option?
I really want something like ManualResetEvent.Pulse(), but it doesn't exist.

Any ideas?
Thanks

Jan 26 '07 #1
1 1039


On Jan 26, 4:16 am, Ben <B...@discussions.microsoft.comwrote:
Hello,
I need to use the functionality of an AutoResetEvent in that it should
normally be non-signalled, but I want something to be able to release all the
waiting threads when I call Set, however AutoResetEvent.Set only releases one
thread.
ManualResetEvent isn't really appropriate because it should remain
non-signalled, i.e. when any thread calls WaitOne() it always needs to block
until 'nudged'.
Is ManualResetEvent.Set() immediately followed by ManaulResetEvent.Reset()
the only option?
I really want something like ManualResetEvent.Pulse(), but it doesn't exist.

Any ideas?
Thanks
Sounds like you want something like Monitor.PulseAll()

--
Tom Shelton

Jan 26 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Carlos Lozano | last post by:
Hi, I have a multithreading application that reads and writes to com ports. The debug version works with no problems, but the release version don't. They are the same code, the difference is...
3
by: Elhurzen | last post by:
X-No-Archive: Yes >From what I understand, if multiple threads are waiting on a ManualResetEvent after calling WaitOne(), only one thread is guaranteed to be signaled when Set() is called on that...
0
by: =?Utf-8?B?QmVu?= | last post by:
Hello, I need to use the functionality of an AutoResetEvent in that it should normally be non-signalled, but I want something to be able to release all the waiting threads when I call Set, however...
2
by: Piotr Sobolewski | last post by:
Hello, I have such program: import time import thread def f():     global lock     while True:         lock.acquire()         print thread.get_ident()
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.