1
CSC 4304 - Systems Programming Fall 2008
Tevfik Koar
Louisiana State University
December 4th, 2008
Lecture - XXIII
Final Review
Using make
2
Implicit Rules
3
Using Variables in Makefiles
4
Libraries
5
Static vs Dynamic Libraries
6
Final Review Tevfik Ko ar Louisiana State University December 4 th - - PDF document
CSC 4304 - Systems Programming Using make Fall 2008 Lecture - XXIII Final Review Tevfik Ko ar Louisiana State University December 4 th , 2008 1 2 Implicit Rules Using Variables in Makefiles 3 4 Libraries Static vs Dynamic Libraries
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Date: Thu, 06 Nov 2008 18:27:13 GMT Server: Apache <HTML><HEAD><BODY> ....
17
18
19
20
21
Advantages (Thread vs. Process):
Disadvantages (Thread vs. Process):
– They don’t have to run on the same processor
data
kernel:
– If one thread blocks, all threads in task block.
22
int main() { pthread_t thread1, thread2; /* thread variables */ pthread_create (&thread1, NULL, (void *) &print_message_function, (void*)”hello “); pthread_create (&thread2, NULL, (void *) &print_message_function, (void*)”world!\n”); pthread_join(thread1, NULL); pthread_join(thread2, NULL); exit(0); } 23
Why use pthread_join? To force main block to wait for both threads to terminate, before it exits. If main block exits, both threads exit, even if the threads have not finished their work.
24
Using Pipes:
25
26
27
28
29
30
31
32
33
34
35
36
37
38
can still have race race conditions.
pthread_create()
to other threads that lock the mutex.
39
40
41
42
43
44