Answer to Question #29048 in Java | JSP | JSF for Phil

Question #29048
How can I simulate busy waiting in Java threads without using suspend();, wait(); notify(), and notifyAll()?
1
Expert's answer
2013-04-24T08:54:11-0400
You can do it in this way:
thread1:

while(!sharedBoolean) {
//busy wait
}

thread2:

sharedBoolean = true;//will wake up thread1

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS