autoresetevent Questions

3

Solved

I am new to these concepts. But as i am going deeper in threading i am getting confused. What is the significance of mutex, semaphore over autoresetevent. Only difference i came to know with stud...
Skindive asked 11/1, 2012 at 6:27

7

Solved

I have a grid with a button in a WPF application. When the user clicks the button, a method in a utility class is executed which forces the application to receive a click on the grid. The code flow...
Ape asked 13/4, 2020 at 11:12

11

Solved

I have read the documentation on this and I think I understand. An AutoResetEvent resets when the code passes through event.WaitOne(), but a ManualResetEvent does not. Is this correct?
Gehenna asked 30/9, 2008 at 16:33

4

Solved

i'm using wpf, there's a button on my ui. when the user clicks it, i have a for loop that runs a new method, on a new thread using autoresetevent. in that method on that new thread, i'm using a...
Erv asked 15/12, 2011 at 22:55

6

Solved

Could someone introduce an use case for AutoResetEvent.Reset() method ? When and why I would like to use this method ? I understand WaitOne and Set but this is quite unclear for me.
Sigismond asked 3/5, 2011 at 14:27

3

Solved

Essentially, what I'm doing is creating a web server to handle an API call, and then when it's done continue the method execution, so essentially: new WebServer(myAutoResetEvent); myAutoResetEvent...
Inspirit asked 31/12, 2015 at 15:59

5

Solved

If I do this : private static System.Threading.AutoResetEvent event_2 = new System.Threading.AutoResetEvent(false); And then in Main thread I do : event_2.Set(); It changes the state from f...
Paw asked 9/10, 2015 at 11:41

6

Solved

What should I use to get semantics equivalent to AutoResetEvent in Java? (See this question for ManualResetEvent).
Chaplin asked 7/7, 2009 at 12:15

4

Solved

I'm playing around with a simple console app that creates one thread and I do some inter thread communication between the main and the worker thread. I'm posting objects from the main thread to a ...
Baptlsta asked 13/1, 2014 at 15:32

4

Solved

Consider the following pattern: private AutoResetEvent signal = new AutoResetEvent(false); private void Work() { while (true) { Thread.Sleep(5000); signal.Set(); //has a waiting thread defini...
Stroh asked 4/9, 2013 at 8:47

4

I have written what I hope is a lightweight alternative to using the ManualResetEvent and AutoResetEvent classes in C#/.NET. The reasoning behind this was to have Event like functionality without t...
Basically asked 12/5, 2010 at 7:57

1

Solved

I'm trying to implement AutoResetEvent. For the purpose I use a very simple class : public class MyThreadTest { static readonly AutoResetEvent thread1Step = new AutoResetEvent(false); static rea...
Csch asked 23/1, 2013 at 14:7

2

Solved

Windows allows the creation of (named) Event objects. An Event (the synchronization primitive in Windows) can be of type auto-reset (in which case you could say it's kind of a semaphore) or it can ...

1

I have the following code in a test: private void LoadIncomeStatementViewModel() { using (var evt = new AutoResetEvent(false)) { EventHandler handler = (sender, e) => evt.Set(); _incomeSt...
Clermontferrand asked 9/9, 2010 at 23:53

3

Solved

I was wondering , Why would I ever want to pass a true in the ctor of AutoResetEvent ? I create a waitHandle so that anyone who will call WaitOne() will actually wait. If I instance it with a ...
Medlar asked 5/12, 2012 at 8:48

2

Solved

I need some mechanism reminiscent of Win32 reset events that I can check via functions having the same semantics with WaitForSingleObject() and WaitForMultipleObjects() (Only need the ..SingleObjec...

5

Solved

I have an object in a worker thread, which I can instruct to stop running. I can implement this using a bool or an AutoResetEvent: boolean: private volatile bool _isRunning; public void Run() { ...
Gardiner asked 14/8, 2012 at 13:22

2

Solved

Is it possible to check how actually AutoResetEvent object was treated? Is it fired by timeout or by calling Set() from another method? Here is my code. private AutoResetEvent autoResetEvent = ne...
Krafftebing asked 16/7, 2012 at 16:53

3

Solved

I'm trying to design a data-structure around a stack that blocks until the stack has an item available. I tried using an AutoResetEvent but I think I misunderstood how that synchronization process ...
Circumvolution asked 16/12, 2011 at 19:37

1

Solved

I understand I've asked this question before: What is the C++ equivalent for AutoResetEvent under Linux? However, I'm learning that in C++0x, the threading library are made much simpler, so I want...
Walt asked 16/12, 2011 at 18:33

4

Solved

I've had the following code in my application for some years and have never seen an issue from it. while ((PendingOrders.Count > 0) || (WaitHandle.WaitAny(CommandEventArr) != 1)) { lock (Pendi...
Mismate asked 29/4, 2010 at 21:54

3

Solved

How to properly synchronize this? At the moment it is possible that SetData is called after e.WaitOne() has completed so d could be already set to another value. I tried to insert locks but it resu...
Whipperin asked 17/8, 2009 at 23:17
1

© 2022 - 2024 — McMap. All rights reserved.