A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Java 8 in Action
this week in the
Calling methods on a waiting thread
Joined: Jul 14, 2005
Apr 06, 2006 17:23:00
IF a thread is waiting on an object, and some other threads call the thread's methods, do the method calls get queued up and invoked when the thread is notified?
SCJP 1.4<br />SCJD
author and iconoclast
Joined: Jul 08, 2003
Apr 06, 2006 18:28:00
methods. A method always runs on the Thread that calls it -- although sometimes, the calling thread has to wait for the privilege.
If a Thread is waiting on an object, that actually has no effect at all on any other threads that call any of that same object's methods.
[Jess in Action]
It is sorta covered in the
JavaRanch Style Guide
subject: Calling methods on a waiting thread
Why Thread isn't being notified in this case
difference between wait() and sleep()
how to release the lock??
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014