Questions tagged [waithandle]

In .Net, WaitHandles are used for synchronization among threads. They contain a handle to the OS's synchronization primitive. Mutex, Semaphore, and EventWaitHandle are exemples of classes that inherit from WaitHandle.

See http://www.albahari.com/threading/part2.aspx for a tour of the available synchronization constructs in .Net.

113 questions
0
votes
2 answers

AJAX - timed mySQL queries (please wait screen)

I need to make an AJAX page which queries the database on page load and then every 5-10 seconds after that. In the meantime I will display some kind of waiting page (maybe with a animated gif to keep my customers entertained :) ) I am working with…
Mark
  • 5,423
  • 11
  • 47
  • 62
0
votes
1 answer

Task scheduling and WaitHandles

I am trying to have multiple tasks consuming objects from a concurrent collection but only when a specific resource is available. For the reason of signaling the availability of this resource, I have used a ManualResetEvent, and my task body looks…
Edmondo
  • 19,559
  • 13
  • 62
  • 115
0
votes
2 answers

WaitHandle.WaitAny() & WaitHandle.WaitAll() usage problem

My application is not exiting properly. I am just trying to print the total number of connections, after that waiting for all the upload operations to complete, and then quit gracefully. Below is the code... using System; using System.Net; using…
deostroll
  • 11,661
  • 21
  • 90
  • 161
0
votes
1 answer

Waiting for multiple TcpClients to have data available - WaitHandle or Thread.Sleep?

I am writing a server application that will receive data from multiple TCP connections. We would like to be able to scale to ~200 connections. The first algorithm I wrote for this is as follows: while (keepListening) { foreach (TcpClient client…
Mason
  • 703
  • 6
  • 20
0
votes
1 answer

C# Wait Handle for Callback

I have a Problem with some of my Methods and I think, a WaitHandle is the solution. I create a Incident through a API to a Ticketsystem. private void create_Incident(string computer_idn, string swidn_choice, string swName_choice, string CI_Number,…
mnlfischer
  • 397
  • 4
  • 12
  • 26
0
votes
3 answers

WaitHandle is closed when it shouldn't have

This code works, for most of time, so I'm thinking of some race condition. Result class is immutable, but I don't think the issue is with that class. public Result GetResult() { using (var waitHandle = new ManualResetEvent(false)) { …
mnn
  • 1,952
  • 4
  • 28
  • 51
0
votes
0 answers

How to wait for user to complete the data entry before processing with waithandle

I have UI which allows user to enter data, every time when the user enter a data I raise an event saying data changed at this location and put it in a queue. I have a background thread which listens to the events with waithandle with waitany. Every…
Nair
  • 7,438
  • 10
  • 41
  • 69
-1
votes
1 answer

WaitHandle fundamental behavior

Have those two code blocks the same effect when looking at the console? Please note: Currently I am still using and bound to .NET 3.5. First: for(int i = 0; i<3;i++) { Console.WriteLine(i); } Second: class Worker { static int i = 0; …
Martin Meeser
  • 2,784
  • 2
  • 28
  • 41
1 2 3 4 5 6 7
8