Professional Documents
Culture Documents
Lecture 14
Threads 2
Read Ch 5.4 - 5.8
printf("sum = %d\n",sum);
}
Silberschatz, Galvin and Gagne 2002
Operating System Concepts 5.12 Modified for CSCI 399, Royden, 2005
The thread function
if (upper > 0) {
for (i = 1; i <= upper; i++)
sum += i;
}
pthread_exit(0);
}
Java Threads:
Java threads may be created by:
Extending Thread class
Implementing the Runnable interface.
Java threads are managed by the JVM.