Questions tagged [busy-waiting]
101 questions
0
votes
1 answer
Code not working once deployed
I've got the following code in a thread in my application:
while (true) {
if (ready) {
progressIndicatorController.value++;
return;
}
}
The ready variable is changed from a delegate method. This code works great when I open…

Frog
- 1,631
- 2
- 17
- 26
0
votes
1 answer
Implementing signal handling on a sleep loop
One of the modules in an app I'm working on is intended to be used as a long-running process on Linux, and I would like it to gracefully handle SIGTERM, SIGHUP and possibly other signals. The core part of the program is in fact a loop which…

shevron
- 3,463
- 2
- 23
- 35
0
votes
4 answers
Waiting Dialog doesn't works correctly and the app freezes until the task end
I have a class that sends various mail with attachments.
Because the method sendEmail(addresses); requires time to upload the attachments and send the emails, I have created an AsyncTask to show a waiting dialog,
however, unfortunately, during the…

AndreaF
- 11,975
- 27
- 102
- 168
0
votes
1 answer
Waiting Icon for loading a pdf in browser via ashx handler
Handling a pdf response from an ashx handler call.
I have a generic ashx handler in C# 4.0 that creates a pdf for me.
I call this handler from javascript in a browser by building a url to send to the handler.
So my final call to obtain the pdf is…

VBAHole
- 1,508
- 2
- 24
- 38
0
votes
0 answers
Automation implementation using Busy Waiting or Threads in c++
I am trying to automate the handler equipment(a robot picks a chip and put it onto a hardware platform) with the following requirement:
1.There are 6 sites for the handler , once handler puts a device onto that site, handler will return an…

Tony
- 1
- 2
-1
votes
1 answer
Is pthreads doing busy waiting internally?
I would like to know if pthreads is doing busy waiting internally when calling pthread_cond_timedwait()?
I'm analysing a multi-threaded program and need to know if a thread is potentially blocking ressources when calling the above…

new2f7
- 51
- 6
-1
votes
2 answers
Make thread wait for condition but allow thread to remain usable while waiting or listening for a signal
Given a situation where thread A had to dispatch work to thread B, is there any synchronisation mechanism that allows thread A to not return, but remain usable for other tasks, until thread B is done, of which then thread A can return?
This is not…

pnizzle
- 6,243
- 4
- 52
- 81
-1
votes
1 answer
How to get the call waiting state of a new incoming call during a phone conversation?
Based on my requirement i need to track all incoming phone calls.
i successfully track the incoming and missed calls through broad cast receivers.
But i didn't get the call waiting state.In that state i missed to track the both incoming numbers.
If…

kiran
- 3,244
- 7
- 34
- 57
-1
votes
3 answers
doing lot of work after notify() will cause wait() become busy wait?
if i have the below piece of code
synchronized (this)
{
System.out.println("Waiting for return key.");
scanner.nextLine();
System.out.println("Return key pressed.");
notify();
Thread.sleep(5000);
}
After notify, I am calling…

user3631009
- 31
- 3
-2
votes
2 answers
Golang sleep thread instead of busy waiting
I am writing a Go implementation of Leslie Lamport's Bakery algorithm, which has busy-spin-waits to handle some maximum number of threads.
I am writing a go function that should not proceed unless a special condition is met. My code so far looks…

Bat
- 771
- 11
- 29
-2
votes
1 answer
Is empty loop too costly?
For example in JavaScript, I want to watch a variable and block the control until the variable is changed. I could do something like this:
var foo = 1;
// Some async function that will modify `foo`
while (foo === 1){}
//This code will run after…

snehanshu.js
- 137
- 1
- 12