-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththreadSlides.html
73 lines (65 loc) · 1.86 KB
/
threadSlides.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<html>
<body>
<h1 align="center">Slides on Java Multithreading</h1>
<h3 align="center">
<em>Lixin Tao</em>
</h3>
<h3 align="center">February 1, 2005</h3>
<hr>
<p align="center">
<b>Overview</b>
</p>
<p align="center"> (all) </p>
<ul>
<li>Why <em>Multithreading</em> is great</li>
<li>
<em>Windows</em> and <em>Unix</em> support multithreads</li>
<li>
<em>Java</em> supports multithread programming</li>
<li>For more information, please visit
<a href="http://java.sun.com">Java Home</a> and
<br>
<a href="http://www.boarland.com">http://www.boarland.com</a>
</li>
</ul>
<hr>
<p align="center">
<b>Why Multithreading is Important?</b>
</p>
<p align="center"> (exec) </p>
<ul>
<li>CPU switching among threads is more efficient
<ol>
<li>Process generation is slow</li>
<li>Process context switching is slow</li>
<li>Thread is also called light process</li>
</ol>
</li>
<li>Serving multiple clients concurrently</li>
<li>More reponsive user interface</li>
</ul>
<hr>
<p align="center">
<b>How does it Work</b>
</p>
<p align="center"> (tech) </p>
<ul>
<li>All threads can run concurrently</li>
<li>CPU number < thread number</li>
<li>Thread synchronization</li>
<li>
<pre>Thread State Diagram:
start [finish]
(New thread) -------> (Run) --------> (terminated)
/ | \
_________/ | \_________
| | |
wait | time|out | [CPU available]
| \/ |
(blocked)---->(Ready)--------->
</pre>
</li>
</ul>
<hr>
</body>
</html>