Open
Description
The main goal of this exercise is to introduce threads and let people get their hands dirty with concurrent code. It should be an entry-level exercise that does not require previous experience with concurrency.
Location
- create a new high-level module
7-0-java-concurrency
- add
7-0-0-hello-theads
exercise
Task
I guess it should be something like one class with a list of very simple methods. Each of those methods should require a person to implement a simple Thread-related logic. Here's a complete example
- accept some logic as
Runnable
and return a newThread
based on it - accept a thread and start it
- accept a thread and return its name
- accept a thread and return its state
- accept some logic, create a thread, start it and return it
- accept working thread and wait for it to complete (join)
- accept a thread and return its state
- accept a list of tasks (Runnable) and return a list of threads that are in progress
- accept a thread and make it sleep