Question: Through its implementation, this project will familiarize you with the creation and execution of threads, and with the use of the Thread class methods. In

 Through its implementation, this project will familiarize you with the creationand execution of threads, and with the use of the Thread classmethods. In order to synchronize the threads you will have to use(when necessary), run(), start( ), currentThread(), getName), join(), yield( ), sleep(time), isAlive(),getPriority), setPriority(), interrupt(), islnterrupted(), and maybe synchronized methods In synchronizing threads, DO

Through its implementation, this project will familiarize you with the creation and execution of threads, and with the use of the Thread class methods. In order to synchronize the threads you will have to use (when necessary), run(), start( ), currentThread(), getName), join(), yield( ), sleep(time), isAlive(), getPriority), setPriority(), interrupt(), islnterrupted(), and maybe synchronized methods In synchronizing threads, DO NOT use any semaphores. DO NOT use wait(), notifv() or notifyAll): In the next story they are two types of threads: racer and judge The Race A number of racers will compete in a race with three obstacles: The Forest, The Mountain and The River. Before the first obstacle and between any two obstacles, the racers will stop for rest and food (by sleeping for a random time). The sequence of events will be something similar to Rest Forest Rest Mountain Rest River Get Home Note: you will need to keep track of the time when a racer started a specific obstacle and when it ended that obstacle, together with the time when the racer started the race until he finished the race The obstacles are described below: The Forest: You will have to use the setPriority(), getPriority() and yield() methods At the entry to the forest, the racer will try to rush as much as possible (simulated by increasing its current priority by a randomly generated number between 0-4) Through its implementation, this project will familiarize you with the creation and execution of threads, and with the use of the Thread class methods. In order to synchronize the threads you will have to use (when necessary), run(), start( ), currentThread(), getName), join(), yield( ), sleep(time), isAlive(), getPriority), setPriority(), interrupt(), islnterrupted(), and maybe synchronized methods In synchronizing threads, DO NOT use any semaphores. DO NOT use wait(), notifv() or notifyAll): In the next story they are two types of threads: racer and judge The Race A number of racers will compete in a race with three obstacles: The Forest, The Mountain and The River. Before the first obstacle and between any two obstacles, the racers will stop for rest and food (by sleeping for a random time). The sequence of events will be something similar to Rest Forest Rest Mountain Rest River Get Home Note: you will need to keep track of the time when a racer started a specific obstacle and when it ended that obstacle, together with the time when the racer started the race until he finished the race The obstacles are described below: The Forest: You will have to use the setPriority(), getPriority() and yield() methods At the entry to the forest, the racer will try to rush as much as possible (simulated by increasing its current priority by a randomly generated number between 0-4)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!