manualresetevent Questions
9
Solved
Consider a Console application that starts up some services in a separate thread. All it needs to do is wait for the user to press Ctrl+C to shut it down.
Which of the following is the better way...
Visceral asked 6/4, 2010 at 16:45
1
Solved
From NET 4 I can use the ManualResetEventSlim class that make a little spinning before blocking in order to get a time optimization if the blocking time is little (I have no context switch).
I'd li...
Keratitis asked 12/3, 2022 at 0:30
1
Solved
I have a long running process that sends data to the other machine. But this data is received in chunks (like a set of 100 packets, then delay of minimum 10 seconds).
I started the sending f...
Lotti asked 6/3, 2020 at 8:22
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
3
Solved
i am not familiar with the usage of ManualResetEvent ?
is it thread related. what it does and when it is used?
here i got a code where ManualResetEvent is used but i just do not understand what i...
Bolger asked 27/3, 2013 at 10:13
1
I am writing a program that has a few threads, each with a while loop that runs until the user specifies it should stop. I thought of a few ways to exit out of the loops, and subsequently the threa...
Timmerman asked 9/12, 2014 at 23:13
2
Solved
The MSDN documentation for ManualResetEventSlim states
You can use this class for better performance than ManualResetEvent when wait times are expected to be very short.
How long is "very shor...
Fermat asked 19/6, 2014 at 15:34
2
Solved
I've written a WPF WizardFramework which performs some actions in the background using some BackgroundWorker. While processing it can happen that I have to update an ObservableCollection which is b...
Vase asked 17/12, 2013 at 12:24
7
Solved
I am not sure which strategy to adopt...I am focusing on my operation getting completed, but I'd also like to keep performance issues to a min too...there is a method called Execute() which has to ...
Rillis asked 4/11, 2009 at 19:6
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
2
Solved
I have a problem in a production service which contains a "watchdog" timer used to check whether the main processing job has become frozen (this is related to a COM interop problem which unfortunat...
Fussbudget asked 20/3, 2013 at 0:45
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 ...
Demirep asked 11/1, 2013 at 15:52
1
Solved
I'm trying to implement a class which uses a simple cache for holding data retrieved from an internal service. I'm using a ManualResetEvent to block multiple threads which may try to refresh the ca...
Phocis asked 25/7, 2012 at 9:23
2
Solved
I am attempting to utilize MSDN's Asynchronous Client Socket code sample to connect and control some home equipment. As I understand, the sample code's ReceiveCallback method uses an instance of th...
Gin asked 12/7, 2012 at 14:22
2
I encounter a deadlock caused when locking instance of manualResetEvent. I can't figure out how to solve it. I will appreciate any help.
I have 2 methods in a class performed by different threads:...
Quatre asked 16/3, 2011 at 8:35
4
Solved
The method below should return true for the first call, and false for any other call.
Is there any problem with it? Is it safe to use the reset event for locking?
private ManualResetEvent _reset...
Triplex asked 21/3, 2011 at 9:8
4
Solved
I'm a little confused over a ManualResetEvent that I'm using which doesn't appear to be unblocking. Anyone know why this might be the case?
The scenario I've got is something along these lines. Th...
Seminary asked 30/7, 2009 at 10:10
4
Solved
I feel like I should know the answer to this, but I'm going to ask anyway just in case I'm making a potentially catastrophic mistake.
The following code executes as expected with no errors/excepti...
Read asked 25/2, 2010 at 19:0
2
Solved
I implemented the following background processing thread, where Jobs is a Queue<T>:
static void WorkThread()
{
while (working)
{
var job;
lock (Jobs)
{
if (Jobs.Count > 0)
job = J...
Karalynn asked 12/7, 2009 at 15:34
1
© 2022 - 2024 — McMap. All rights reserved.