waithandle Questions
8
Solved
My application spawns loads of different small worker threads via ThreadPool.QueueUserWorkItem which I keep track of via multiple ManualResetEvent instances. I use the WaitHandle.WaitAll method to ...
Puerility asked 23/4, 2010 at 23:31
2
Solved
Edit: I'd like to plead temporary insanity for even asking this question, but it made sense at the time (see edit 2 below).
For a .NET 3.5 project, I have two types of resources (R1 and R2) that I...
Hessenassau asked 19/8, 2009 at 13:51
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
3
Solved
I want to WaitForMultipleObjects on 2 different types:
an 'EventWaitHandle'
a 'Process.Handle' ==> intptr
I don't know how to convert (in the appropriate way) "process.Handle" to a WaitHandle i...
Fugger asked 10/11, 2014 at 20:19
4
Solved
Is there a way to unit test WaitHandle.WaitAll() when using Visual Studio's built-in unit testing solution. When I try and run a test that uses this function within Visual Studio the test fails and...
Truancy asked 14/7, 2010 at 12:46
3
Solved
I need a solution to perform arbitrary pause. The delay accuracy is irrelevant. What is the practical difference in such scenario between WaitHandle.WaitOne Method (TimeSpan) and Thread.Sleep Metho...
Poop asked 22/1, 2014 at 11:47
2
Solved
I was wondering: Locking allows only 1 thread to enter a code region
And wait handles is for signaling : :
Signaling is when one thread waits until it receives notification from
another.
So...
Sackbut asked 24/6, 2013 at 11:4
1
Solved
I have the following code which has the goal to wait for all given wait handles but is cancellable by a specific wait handle:
public static bool CancelableWaitAll(WaitHandle[] waitHandles, WaitHan...
Piston asked 25/2, 2013 at 14:38
2
Solved
I thought that the following code would let all the 10 threads run, two at a time, and then print "done" after Release() is called 10 times. But that's not what happened:
int count = 0;
Semapho...
Female asked 25/1, 2013 at 20:9
1
I have a function that is called in rapid succession that has a open database connection.
my issue is that before one database connection is closed, another instance of the function is called and ...
Yesteryear asked 5/11, 2012 at 23:10
3
Solved
Say I have 10N items(I need to fetch them via http protocol), in the code N Tasks are started to get data, each task takes 10 items in sequence. I put the items in a ConcurrentQueue<Item>. Af...
Peril asked 24/8, 2012 at 13:15
2
Solved
According the the MSDN documentation, Set() and Reset() on ManualResetEvent (or any EventWaitHandle) returns a boolean indicator whether or not the operation was successful.
Under which circumstan...
Koloski asked 3/11, 2010 at 23:58
2
Solved
I'm trying to use a mutex to protect access to some hardware from multiple threads, but I'm confused as to what the exitContext parameter means / does:
public virtual bool WaitOne (
int milliseco...
Smelt asked 19/10, 2011 at 16:15
3
Below is a class having the method 'SomeMethod' that illustrates my problem.
class SomeClass
{
AutoResetEvent theEvent = new AutoResetEvent(false);
// more member declarations
public void Some...
Harlen asked 9/5, 2011 at 16:56
6
Solved
In C#, when we should use WaitHandle instead of lock ?
Underact asked 29/4, 2011 at 13:34
4
Solved
I have a WaitHandle and I would like to know how to check if the WaitHandle has already been set or not.
Note: I can add a bool variable and whenever Set() method is used set the variable to true,...
Absolutely asked 22/7, 2010 at 20:24
4
Solved
Is there a standard way to close out an application "cleanly" while some WaitHandle objects may be in the state of a current blocking call to WaitOne?
For example, there may be a background thread...
Argosy asked 21/6, 2010 at 19:11
6
Solved
Both Thread.Sleep(timeout) and resetEvent.Wait(timeout) cause execution to pause for at least timeout milliseconds, so is there a difference between them? I know that Thread.Sleep causes the thread...
Unbolt asked 8/6, 2010 at 16:6
1
Solved
I'm doing some multi-threading and use AutoResetEvents and ManualResetEvents do control my main - loop. When "destryoing" the threads I also have to dispose these signals, that's clear.
But I saw ...
Cristen asked 27/4, 2010 at 14:37
1
Solved
I'm working with a NamedPipeServerStream to communicate between two processes. Here is the code where I initialize and connect the pipe:
void Foo(IHasData objectProvider)
{
Stream stream = object...
Theater asked 7/4, 2010 at 18:58
6
Solved
I've been reading up on .NET Threading and was working on some code that uses a ManualResetEvent. I have found lots of code samples on the internet. However, when reading the documentation for Wait...
Alonzoaloof asked 10/2, 2010 at 2:58
1
Solved
While reading C# 3.0 in a Nutshell by Joseph and Ben Albahari, I came across the following paragraph (page 673, first paragraph in section titled "Signaling with Wait and Pulse")
"The Monitor cl...
Jacoby asked 23/2, 2010 at 23:55
2
Solved
Quick summary with what I now know
I've got an EventWaitHandle that I created and then closed. When I try to re-create it with this ctor, an "Access to the path ... is denied" exception is thrown....
Vannesavanness asked 23/11, 2009 at 16:43
1
© 2022 - 2024 — McMap. All rights reserved.