12. Threads
Main steps
- Investigate jtm.activity12 package
- Look at Activity12.png to understand design and 3 different approaches of array filling
- Implement classes ArrayFiller, and ArrayFillerManager to pass unit tests
To check load on processor, run top command or System monitor.
Additionally you can add CPU monitor:
- Right click on free space of the panel, select Panel — Add new Items..
- Select CPU Graph and press Add.
- Then left click on CPU graph to open task manager.
You can also install gnome-system-monitor:
sudo apt install gnome-system-monitorThen run Start menu — System — System monitor.
To kill non-responding threads together with Eclipse, enter command:
killall -9 java
You implement latency with Thread.sleep(latency); method
Optional task
- Try to analyse execution of fillParalelly() method step-by-step in Eclipse Debugger.
- Compare it with debugging experience by writing informative messages into standard output by System.out.println() and step-by-step analysis of produced output after execution of your program.