Threads and Thread Synchronization

Threads and Thread Synchronization - arg, flags,...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Threads and Thread Synchronization
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Introduction to Threads A thread is a path execution By default, a C/C++ program has one thread called "main thread" that starts the main() function. main() --- --- printf( "hello\n" ); ---
Background image of page 2
Introduction to Threads You can create multiple paths of execution using: POSIX threads ( standard ) pthread_create( &thr_id, attr, func, arg ) Solaris threads thr_create( stack, stack_size, func,
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: arg, flags, &thr_id ) – Windows CreateThread(attr, stack_size, func, Introduction to Threads • Every thread will have its own – Stack – PC – Program counter – Set of registers • Each thread will have its own function calls, and local variables. • The process table entry will have a stack, set of registers, and PC for every thread in the process....
View Full Document

This note was uploaded on 01/30/2012 for the course CS 354 taught by Professor Staff during the Fall '08 term at Purdue University.

Page1 / 4

Threads and Thread Synchronization - arg, flags,...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online