Multithread Programming
Program Stucture
Tabel Process example
Thread-1 Thread-2 Output Thread -1 Value of a by
Thread -2
CREATE NULL NULL
START A NULL
CREATE A 0
START 0 0
RUN : a++ 1 0
RUN : a++ 1 1
a++ 2 1
a++ 2 2
EXIT 2 2
EXIT 2 2
Experiment
• Write multithread program from module book on the
netBeans/Eclipse
Task
• Make program with following specification: 4 thread, input thread is
string, output thread is character one by one. And Create run down
table for thread. Then try 2 different task starter structure
• Save program listing and rundown table on .doc then upload to Elisa
• Example: Clue: String to Char Array and Output
TIME Thread-
1
Thread-
2
Output
Thread -1
Output
Thread -2
1 CREATE
2 WAIT CREATE
3 WAIT WAIT
4 WAIT WAIT
5 START WAIT
6 WAIT START
7 WAIT WAIT
8 RUN WAIT
9 WAIT WAIT
10 RUN WAIT A
11 WAIT RUN
12 WAIT RUN B

Multithread Programming.pptx