C
cppaddict
Say thread1 begins executing a synchronized method.
While it's executing, both thread2 and thread3 call the synchronized
method, in that order.
When thread1 ends executing and gives up its lock, is thread2
guaranteed to execute next (because it's been waiting longer than
thread3), or is it possible that thread3 executes first?
My experiments seem to point to thread2 always running first in the
above situation, but I'd like to verify this.
Thanks,
John
While it's executing, both thread2 and thread3 call the synchronized
method, in that order.
When thread1 ends executing and gives up its lock, is thread2
guaranteed to execute next (because it's been waiting longer than
thread3), or is it possible that thread3 executes first?
My experiments seem to point to thread2 always running first in the
above situation, but I'd like to verify this.
Thanks,
John