https://github.com/dbc2201/therabbitandthetortoise
https://github.com/dbc2201/therabbitandthetortoise
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dbc2201/therabbitandthetortoise
- Owner: dbc2201
- Created: 2020-10-28T06:17:03.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-30T17:52:32.000Z (over 5 years ago)
- Last Synced: 2025-02-28T08:19:50.849Z (over 1 year ago)
- Language: Java
- Size: 5.86 KB
- Stars: 3
- Watchers: 1
- Forks: 128
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GLA University, Mathura
## BCSC 1002 Object-Oriented Programming
### Multithreading Lab Task
---
**TASK**
- Create a definition class for a "thread" in java,
by implementing the `java.lang.Runnable` interface.
This thread will be the thread for a "rabbit".
- Create a definition class for a "thread" in java,
by extending the `java.lang.Thread` class.
This class will be the thread for a "tortoise".
- The Rabbit thread and the Tortoise thread will have a race.
(they will start executing concurrently)
- The Rabbit thread is a fast one, and it executes
with a step of 1.5s (it sleeps for 1.5s).
- The Tortoise thread is a slow one, and it executes with a step of 3.0s
(it sleeps for 3.0s).
- The milestones in the race are as follows
- The Start Line
- The Cool River
- The Mountain Hill
- The Big Oak Tree
- The Finish Line
- The thread that you create for either of the participant of the race
shall execute in 5 steps for each of the milestones; and don't forget to make them pause (sleep).