473,320 Members | 1,848 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,320 software developers and data experts.

Wait() and Set()

Hello,
I am using Manual Reset Event by defining it in a thread and than doing
mre.WaitOne(), in the other thread which is activated in a handler which
is called due some event I am doing mre.Set()
But There is no way that the part of mre.Set() i reached although when I
erase the MRE part,the event fires.
How can it be explained?
Thank you!

*** Sent via Developersdex http://www.developersdex.com ***
Mar 14 '06 #1
3 2474
csharpula csharp <cs*******@yahoo.com> wrote:
I am using Manual Reset Event by defining it in a thread and than doing
mre.WaitOne(), in the other thread which is activated in a handler which
is called due some event I am doing mre.Set()
But There is no way that the part of mre.Set() i reached although when I
erase the MRE part,the event fires.
How can it be explained?


Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Mar 14 '06 #2
Well,it's more or less this code:

Class A
{
ManualResetEvent mre=new ManualResetEvent();
this.Afunc();
mre.WaitOne();

// Here is a handler to some event which is activated by
// other thread

BHandler(sender,EventArgs args)
{
if (args.counter=1)
{
mre.Set();
}
}
Thank you very much for your help!

}

*** Sent via Developersdex http://www.developersdex.com ***
Mar 14 '06 #3
csharpula csharp <cs*******@yahoo.com> wrote:
Well,it's more or less this code:


"More or less this code" doesn't really help us reproduce the problem -
especially when the code you've provided won't even compile.

Please read http://www.pobox.com/~skeet/csharp/incomplete.html

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Mar 14 '06 #4

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

Similar topics

4
by: GTi | last post by:
Hello... I have a page located in a frame. This page contains a form. When the user submit this form I want to popup a "Please Wait" window popup window The post may take some time for the...
4
by: dave | last post by:
Hi guys I display one page in popup window...that fetches some data from sql and perfom some calculation (tht approx 10 secs) and display result.... I am trying to display "Please wait ..."message...
6
by: Paul | last post by:
Hi just wondering if there is a way to set up a wait for object in vb.net as if a put a delay in between the fill and the databind things work ok, but if not the page is reloading without the...
2
by: s_erez | last post by:
Hi, This is a realy tricky one. I have an ASP.NET application where some pages are reading data from a DB and presenting reports. In order for the user to wait while the page is reading data from...
4
by: Anonymous | last post by:
Hello, I am generating a pdf file via some code. It takes approx. 30 secs to create the pdf and to show it to the user. During that time, I want to show a message like "Please Wait...". Ideally...
12
by: Perecli Manole | last post by:
I am having some strange thread synchronization problems that require me to better understand the intricacies of Monitor.Wait/Pulse. I have 3 threads. Thread 1 does a Monitor.Wait in a SyncLock...
16
by: Thirsty Traveler | last post by:
I would like to create a test harness that simulates multiple concurrent users executing an individual thread. I would like this to be determined at runtime when the user specifies the number of...
6
by: Michael D. Ober | last post by:
I have an application that needs to limit the number of simultaneous threads that are executing at any given time. The threadpool appears to be ideal for this. However, I need to have my Sub Main...
2
by: Doug | last post by:
I have a multi frame dhtml applicaiton that sets a wait cursor in each frame when a request is made to the web server. Essentially this: ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.