All Questions

55
votes
1answers
4180 views

Loop doesn't see changed value without a print statement

In my code I have a loop that waits for some state to be changed from a different thread. The other thread works, but my loop never sees the changed value. It waits forever. However, when I put a Syst...
10
votes
2answers
12227 views

What is the difference between busy-wait and polling?

From the Wikipedia article on Polling Polling, or polled operation, in computer science, refers to actively sampling the status of an external device by a client program as a synchronous activity....
4
votes
2answers
7950 views

Threads: Busy Waiting - Empty While-Loop

During our lessons in the university, we learned about Threads and used the "Busy Waiting" method for an example of a Car waiting at a TrafficLight. For this task we build three classes: TrafficLigh...
3
votes
1answers
137 views

Prevent MPI from busy looping

I have an MPI program which oversubscribes/overcommits its processors. That is: there are many more processes than processors. Only a few of these processes are active at a given time, though, so the...
0
votes
1answers
95 views

How do you pause a thread until a condition becomes true without busy waiting?

How do you pause a thread until a condition becomes true without busy waiting? For example, suppose I'm checking to see whether playerOne.isWalking() Is going to be true and I want to run some ...

Previous Next