© Thomas Kunz 2000
SCE 574
202
   PThreads (POSIX Threads)
äInstead of extensions to languages a package of routines is used
äEnvironment usually initialized using a subroutine call in the main environment
äInteraction mechanisms
äShared memory
äMutex for synchronization
äFork and join primitives
äExamples of operations:
äpthread_create(thread_id, attributes, start_routine, address_of_stack)
äpthread_yield(void)
äpthread_mutex_init(mutex, attributes)
äpthread_mutex_lock(mutex)
äpthread_mutex_unlock(mutex)
äOthers.....
For example
Priority
A variable
of type
pthread
C
Function
A pre-allocated stack
that is expected to be
big enough
Variable of type
pthread_mutex