File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Programmer Certification (SCJP/OCPJP)
What puts a thread in a waiting state?
Louie van Bommel
Joined: Aug 17, 2004
Oct 16, 2004 14:26:00
I believe the following three methods could put a thread in a waiting state: wait(), sleep(), join(). Is this true?
I seem to remember something that states there's a sleeping state. Or is this a subset of waiting state?
What state does yield() cause for the currently executing thread?
Joined: Aug 03, 2002
Oct 16, 2004 14:36:00
Yield puts a thread from running state back to runnable. From there the thread can go immediately back to running, or stay in runnable until it gets rescheduled to go back into running (that's because another thread gets a go at the cpu).
Ask a Meaningful Question
Getting someone to think and try something out is much more useful than just telling them the answer.
Joined: Jul 18, 2004
Oct 16, 2004 14:56:00
Don't forget that there is a "blocked on an object's lock" type of waiting that isn't so obvious.
SCJP 1.4<br />(WIP) SCJD B&S v2.3.3
I agree. Here's the link:
subject: What puts a thread in a waiting state?
Can anybody tell me How to use getState() method with an thread object.
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015