Questions tagged [busy-waiting]

101 questions
0
votes
1 answer

Concurrent programming, sharing values between thread

I am a beginner in concurrent programming, and i would like to understand exactly why this program doesn't end when I comment the sleep(1)in get() My first thought, is that the sleep(1) gives the hand back to the Mainthread, maybe Busy waiting has…
Iraponti
  • 95
  • 2
  • 3
  • 10
0
votes
1 answer

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 code when it does become true. Again suppose…
0
votes
2 answers

Python blocking with queue.get() without exceptions or busy waiting

I have the following thread, for where the queue q is empty most of the time: def run(self): while True: if not self.exit_flag: items = self.q.get() q.work_it() else: return 0 If the exit…
0
votes
3 answers

Semaphores wait() on Multicore

I'm currently studying how semaphores and mutual exclusion actually work and encountered the following problem. Let's assume we have two cores on a CPU. We have two processes, on each core there's running one. We're now calling on both cores a…
0
votes
1 answer

Busy waiting in codebehind - dotnetnuke

I'm writing a small module for a DNN website. I need to update a
every n seconds with the contents of a list from the codebehind, one list item at a time. I set up an on the webpage along with a 5 second . In my…
user3505003
  • 45
  • 1
  • 2
  • 7
0
votes
1 answer

MPI Busy wait for response

I had something like while(j
raycons
  • 735
  • 12
  • 26
0
votes
1 answer

change while(1) loop to busy wait in linux kernel

void cpu_idle (void) { /* endless idle loop with no priority at all */ while (1) { void (*idle)(void) = pm_idle; if (!idle) idle = default_idle; if (!current->need_resched) idle(); …
0
votes
1 answer

Multithreaded console application: Pause on keypress without busy waiting

I am writing a multithreaded console application in C++11. I would love for it to be OS independent, but I am on a linux machine. I want to be able to pause threads upon a keypress, but for the program to be allowed to finish and exit without any…
RghtHndSd
  • 117
  • 5
0
votes
1 answer

Java Threads Busy Waiting

Hi I am doing a project and I have reached a part where I am very stuck. I have tried to search for ways to learn how to write the while loop for a busy wait but I haven't found anything and my code just runs as an infinite loop. Can someone help…
mets1993
  • 15
  • 1
  • 4
0
votes
2 answers

C++ win32 printing to console in fixed timesteps

I am trying to create a function that will allow me to enter the desired frames per second and the maximum frame count and then have the function "cout" to the console on the fixed time steps. I am using Sleep() to avoid busy waiting as well. I seem…
user3023723
  • 7
  • 1
  • 4
0
votes
2 answers

Asp.net show waiting indicator while refresh page (F5)

I use the example in this page and it works ok for submit cases. http://www.aspsnippets.com/Articles/Display-loading-image-while-PostBack-calls-in-ASPNet.aspx but when user refresh page (by button refresh of brower or F5) this indicator is not…
0912144
  • 1
  • 1
0
votes
1 answer

A script on this page may be busy Error in VS2010 ASP.net WebForm

I developed a website in VS 2010 , now I want to run it in VS2013, but for just some oages when I want to run it from VS using FireFox ,this Error is shown. My projects is ASP.net webForm. A script on this page may be busy, or it may have stopped…
Sara N
  • 1,079
  • 5
  • 17
  • 45
0
votes
1 answer

MATLAB busy, loop works well until i=29996, when i=29997 stay Busy

I am writing code which compares the data of a vector. It should count how many positions (acc) have equal values, and save a specific value in a vector of the same length of the quantity of positions (n_T(acc)). My data vector is [30000 x 1]. For…
0
votes
3 answers

Java Puzzler: busy wait threads stop working

This is some sort of a Java Puzzler, that I stumbled across and can't really explain. Maybe somebody can? The following program hangs after a short time. Sometimes after 2 outputs, sometimes after 80, but almost always before terminating correctly.…
0
votes
1 answer

Implementing busy wait with a pair of flags

I am trying to implement a busy waiting mechanism, using 2 flags. I get a deadlock, but just can't understand why... it looks to me as if it should work... sorry for the long code, That's the shortest I succeeded to make it. package pckg1; public…
Matan L.
  • 329
  • 2
  • 7