on the run method to resolve the exception.synchronized
Thanks,
Anurag
SCJP 1.2 & 1.5, PMP
Anurag Blore wrote:Please add
on the run method to resolve the exception.synchronized
abalfazl hossein wrote:
When I run this program ,Always "runner num 2" and "runner num 3" show.
But I don't see runner num 1 at all
Why?
The first thread that runs will just call wait(). When it does get a notification, it will wake up, and do nothing else. DONE.
abalfazl hossein wrote:
With all due respect Sir, If you run this program for 100 times , 1 times you see this:
abalfazl hossein wrote:
May you guide me how can I code for that?Could you write code that can do that?
abalfazl hossein wrote:
Now notifyAll()
Other two threads chage the situation from wait.
abalfazl hossein wrote:
The program lock and stops
runner num 2distance=100
abalfazl hossein wrote:
same result again
abalfazl hossein wrote:give me an example of what you think
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
|