473,799 Members | 3,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Manual Reset Event

Hello,
How can I know that the Manual Reset Event object done WaitOne(). I have
a condition and I want to do Set() to Manual Reset Event in it but I
have to know that there WaitOne() was done on it before. How can I know
that?
Thank you!

*** Sent via Developersdex http://www.developersdex.com ***
Mar 21 '06 #1
2 12562
On Tue, 21 Mar 2006 03:38:14 -0800, juli jul wrote:
How can I know that the Manual Reset Event object done WaitOne(). I have
a condition and I want to do Set() to Manual Reset Event in it but I
have to know that there WaitOne() was done on it before. How can I know
that?


Why would you want to know that? The whole point of a manual reset event is
that once it has been set, it remains in that state until you manually
reset it. So it doesn't matter whether some other thread has called WaitOne
or not. When you're done with whatever task needs to be completed before
other thread can carry on with their work, just call Set(). If there was
other threads waiting, they will be realeased. If other threads arrive
later and call WaitOne(), they won't block since your ManualResetEven t has
already been signaled.
Mar 21 '06 #2
Joe
One solution is to define an additional manual or auto-reset event
which you Set just before calling WaitOne() on the ManualResetEven t.
You can use WaitHandle.Sign alAndWait to make the operation atomic.

Are you trying to implement a "ready" or acknowledgement signal? Maybe
there's a simpler solution to what you're trying to achieve.

Joe

Mar 21 '06 #3

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

Similar topics

2
5798
by: John Smith | last post by:
Hello. Can anybody read this and come up with the solution? I would appreciate any input. In my form I have two fields (Field1 is select and Field2 is text input). Field1 has "onchange" event which fires a function which hides or displays Field2 depending on chosen value of Field1 by means of manipulating style "display" property setting it to "none" or "inline". Everything works fine, but only problem is reset button. When Field1 is...
2
2650
by: Charles M. Fish, Sr. | last post by:
I’m so tired from banging this problem around all day, I hope I can explain it succinctly & accurately. I want to execute a function immediately following a click on <input type="RESET"... The function will insert today’s date into a <input type="TEXT"… field. It does it just fine with <form onload="insertDate();" where inside the ‘insertDate’ fn, I have document.form.dateField.value = dateString. The closest I’ve been able to do...
1
8188
by: Joe Bloggs | last post by:
I have a form which includes a checkbox field. I need to add a reset, I add a HTML reset it works fine before I submit the form but not after. I know I must add some code to reset the checkbox on the onclick event of the reset button but I don't know what the code should be. Below is the HTML for the Data grid that has the check box and the code from the C# behind code for the reset button. If someone could point me in the right direction...
1
14385
by: NancyASAP | last post by:
Thought I'd share this since it took me a long time to get it working. Thanks to a bunch of contributers in Google Groups who shared javascript, etc. The question was: How can I put a reset button on my ASP.NET web page, and have an HTML reset button click clear 1) all validator text display and 2) validation summary display. Problem was clearing them and yet still leaving them working and visible if the user immediately began...
4
5334
by: Lee Chapman | last post by:
Hi, Can anyone tell me why in the code below, the call to ClearChildViewState() has no effect? To paraphrase the code: I'm using view state. I have a textbox and a submit button (and a label that can be ignored). When I press the button the first time, the click handler hides the textbox. Pressing the button a second time unhides the textbox. The text box is maintaining its value when hidden via view state. (The value is NOT being...
4
3196
by: Charles Law | last post by:
I've been using monitors a bit lately (some of you may have heard ;-) ) and then up pop Manual and AutoResetEvents , and they look for all the world like the same thing. Are they interchangeable, or when should I use one over the other? TIA Charles
2
1804
by: sck10 | last post by:
Hello, I have 3 repeater controls referencing the same function below. What it is doing is testing to see if the first column repeats itself and if so, add a line with the managers name. The problem I have is how to reset "strBlankRow" after each repeater control is finished. Thanks, sck10
16
16694
by: sreemati | last post by:
Hi everyone, This is the scenario: I have two button - Submit and Reset Submit is used for validation and after validation is passed it passes it to another form to enter into database. Bascially the reset works fine if I use it before using the submit button in the form. For instance,if on submit there is some error as the values have not passed a validation. There is a error pop up message shown and the values are retained in...
11
7426
by: newbie | last post by:
i have a form in which a hidden field (initial value as '0', and my javascript set it to '1' when an event is trigged). In the same form, i have a reset field. But I realized that the hidden field is not reset to '0' when i push the reset button. If I simply change the node from "<input type="hidden" id='IsChanged' value='0'>" to "<input type="text" id='IsChanged' value='0'>" Everything is working as expected (the value is reset to '0'...
0
9546
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10491
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10247
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9079
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7571
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4146
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.