Questions tagged [manualresetevent]

ManualResetEvent notifies one or more waiting threads that an event has occurred

ManualResetEvent notifies one or more waiting threads that an event has occurred

References

136 questions
0
votes
2 answers

Multiple asyn calls in same method. The right way?

I need to fetch my public IP address from one of the IP address provider URLs. The catch is that these services are not reliable so I must have fallback to different URLs. To obtain maximum performance, I want to initiate WebRequest to all service…
PC.
  • 6,870
  • 5
  • 36
  • 71
0
votes
1 answer

Waiting DownloadFileAsync with ManualResetEvent c++/cli

i'm having a little but frustrating problem in my C++/CLI with windows forms application. So the problem is that i have to download a file from a webserver by using a WebClient istance. Normally i use DownloadFile and not DownoadFileAsyn, but if i…
0
votes
0 answers

ManualResetEvent in dll used for Unity3D

I have a C# class library (.Net 3.5) compiled as dll and imported to Unity3D. In certain method I must wait on main thread before continuing main process. So I use a ManualResetEvent object to wait a specified duration before timeout. But in Unity3D…
0
votes
1 answer

Updateable (resetable) timeout of Wait on a synchronization construction such as ManualResetEvent

Here is the description of the problem: I need to make an API call synchronized. In order to make this call synchronized, I defined a ManualResetEvent and called WaitOne on it. WaitOne is called after the call to external COM object. In some…
EngineerSpock
  • 2,575
  • 4
  • 35
  • 57
0
votes
0 answers

how to release thread is required in multiple thread?

As title, how to release thread is required in multiple thread ? Ex : I have 5 thread is waiting. I only want thread position 3 is released I use autoresetevent/manualresetevent/monitor.wait and monitor.pulse but all release thread follow FIFO help…
Cornor
  • 33
  • 2
  • 9
0
votes
1 answer

In .NET when Aborting Thread, can this piece of code get corrupted?

Little intro: In complex multithreaded aplication (enterprise service bus ESB), I need to use Thread.Abort, because this ESB accepts user written modules which communicates with hardware security modules. So if this module gets deadlocked or…
bosko
  • 25
  • 1
  • 7
0
votes
0 answers

manualresetevent.waitone is hanging

I have a windows service with a timer. About 3 times a day the timer uploads files to different ftp servers. I set the timer, upload the files, then set the next time. This worked fine for a while, until I added another ftpserver for uploading…
0
votes
2 answers

Server multithreading overkill?

I'm creating a server-type application at the moment which will do the usual listening for connections from external clients and, when they connect, handle requests, etc. At the moment, my implementation creates a pair of threads every time a…
Barguast
  • 295
  • 6
  • 11
0
votes
0 answers

How to check the thread state for ManualResetEvent or call when it's blocked?

I would like to call _myThread.Abort() after my ManualResetEvent blocked a thread. So either I want to check whether the Thread is already blocked, or I want to call a delegate which only calls _myThread.Abort() right after the thread has been…
xamid
  • 440
  • 11
  • 25
0
votes
1 answer

NSOperationQueue Pause & Resume?

I implemented Thread pooling using NSOperationQueue. In which i set maxConcurrentOperationCount to 25. i.e. concurrently 25 threads are running at a time. I am uploading chunks to a server by using this NSOperationQueue. So chunks are allocated to …
0
votes
1 answer

MaualResetEventSlim not stopping the thread

I have following code in my sample application : private static ManualResetEventSlim _screenSaverOn = new ManualResetEventSlim(); private static ManualResetEventSlim _screenSaverOff = new ManualResetEventSlim(); In constructor of the class I have…
Pawan Mishra
  • 7,212
  • 5
  • 29
  • 39
0
votes
2 answers

ManualResetEvent vs while loop

ManualResetEvent basically says to other threads "you can only proceed when you receive a signal to continue" and is used to pause execution for certain threads until certain condition has been fulfilled. What I want to ask is that why…
user1928346
  • 513
  • 6
  • 21
0
votes
1 answer

ManualResetEvent with a BackgroundWorker : Current thread is busy while WaitOne()?

Imagine following situation: I got a signal on the ui thread from a third party server. I start a BackgroundWorker with RunAsync to fetch data from a database and another async thread, which shall poll another hardware and receive signals, also…
icbytes
  • 1,831
  • 1
  • 17
  • 27
0
votes
1 answer

Using WaitHandle

I'm trying to do something like this: EventWaitHandle handler = new EventWaitHandle(false, EventResetMode.AutoReset) //This code will run in background thread private void AsyncWait() { while (true) { handler.WaitOne(); …
ch0eb1t
  • 103
  • 8
0
votes
1 answer

ManualResetEvent.WaitOne() causes AccessViolation

An ASP.NET invoice application has a save button, that triggers (among other things) the generation of a pdf file on disk using the form data, the userID etc. An excerpt from the GeneratePDF method: ManualResetEvent…
Wim Ombelets
  • 5,097
  • 3
  • 39
  • 55