Questions tagged [countdownevent]

In the .Net framework a CountdownEvent is an object that represents a thread synchronization primitive that is signaled when its count reaches zero. It can be used to synchronize returning threads.

14 questions
13
votes
8 answers

Return to zero CountdownEvent

I'm trying to use a CountdownEvent to only allow threads to continue when the event's count is zero, however I would like the initial count to be zero. In effect I'd like a return to zero behaviour whereby the event is signalled whenever the count…
chillitom
  • 24,888
  • 17
  • 83
  • 118
2
votes
1 answer

Best Practice for thread delays with countdown notification

I tend to use the following pattern a lot of different places for a timed delay with countdown notification events, and the ability to cancel: CancellationToken ctoken = new CancellationToken(); for (int i = 0; i < 10; i++) { if…
drharris
  • 11,194
  • 5
  • 43
  • 56
2
votes
2 answers

CountDownEvent won't wait until all the signals have been called

I am looking at this site for threads. I have been playing with the code to answer the question "Does the CountdownEvent stop all threads?" the answer I got was no. Then I decided to play with the number that is passed into the CountdownEvent. Here…
Darren Hoehna
  • 269
  • 2
  • 8
  • 19
1
vote
2 answers

How to create a count down clock without using CountDownTimer

So basically i think ive tried every possible way of handling this with the CountDownTimer but the best i got wasn't good enough. What im trying to do exactly is to display a count down timer for a game app, that once the time hits 0 it starts an…
MirrowPR
  • 45
  • 6
1
vote
1 answer

Loop with Countdowntimer [autorestart]

Hello I have a timer which I want to restart 4 times in a row always as soon as it ends. I want to use a for Loop like this: for(int i = 0; i<=3; i++) My problem is, that I don´t know how to use the loop in my code. I don´t know where to add the i…
user3579236
0
votes
1 answer

Async wait for multiple threads to finish

I have a code block which is eventually accessed by multiple threads. I search for an up to date async mechanism to continue executing when all threads have passed. Currently I do the following with a CountDownEvent which works just fine (without…
0
votes
2 answers

How to do a counter with JavaScript

I'm making a countdown, which I want to set with a form. Also, I would like to store the data I'm sending in. I need this counter to be called in other parts of the site as I'm doing this for the admin of a web page. I'm not sure if local storing or…
0
votes
2 answers

I want to set a countdown time and keep deadline reducing php

Sorry that I am unable to express the question properly. Basically what I need to do is this. There should be a php page which shows the countdown timer. Say the admin sets it for 24 hours now and starts. Who ever visits that page, it shows the…
vikram
  • 189
  • 3
  • 13
0
votes
2 answers

CountdownEvent not waiting for all threads to signal

I've got the following multithreaded code for calculating Euler's number. I'm new in multithreaded programming and maybe I'm missing something. For some reason countdown.Wait() is not waiting for all the threads and totalSum is different almost…
0
votes
1 answer

Overlapping content (css and div blocks)

I am customising a responsive website for a event so I added a countdown with jquery only the problem is that I have 2 css overlapping and the countdown is not good positioned. Can someone help me to positioned the countdown and find the css code…
Jordi
  • 3
  • 1
0
votes
1 answer

Downloading strings using a Threadpool and waiting for the download to complete

I am using a WebClient to upload a string an retreive the answer from the server. To get the job done quicker, I decided to use the ThreadPool, but I need to know when all the downloads are over. So far, I've been using a CountdownEvent which is…
0
votes
1 answer

Using CountdownEvent and ManualResetEvent to control threads in ThreadPool

I've got the following multithreaded code excerpt that I've been working on to compare files following a zipped copy and unzip. The application is zipping a folder containing a variable number of files of various sizes, copying the files to a…
0
votes
1 answer

CountdownEvent never is set to zero

I need to download a few text from different urls, then I am using the CountDownEvent to handle the number of times that my event Donwnload is completed, but the thing is my CountDownEvent never is set to Zero and this remains waiting. Any idea what…
luis_laurent
  • 784
  • 1
  • 12
  • 32
0
votes
1 answer

Main thread not proceeding when child threads have finished

I am trying to use multithreading in my application. The method test5 tries to fetch some content from Internet, while the main thread waits for all threads to finish before continuing with other work. But my main thread doesn't come back after…
Hami
  • 335
  • 1
  • 7
  • 22