Lecture 11 - More Unix Systems Programming, POSIX Semaphores, SysV Semaphores
Agenda
Announcements
Lab 5 continues. Remember, the
system()
system call is not allowed.
More Unix Systems Programming
POSIX Semaphore Implementation
Examples
pipes
FreeBSD POSIX semaphore implementation:
actual library calls:
/usr/src/lib/libc_r/uthread/uthread_sem.c
struct sem
definition:
/usr/src/lib/libc_r/uthread/pthread_private.h
FreeBSD Pthreads implementations:
pthread mutex implementation:
/usr/src/lib/libc_r/uthread/uthread_mutex.c
pthread condition variable implementation:
/usr/src/lib/libc_r/uthread/uthread_cond.c
System V Semaphores:
prodcons-sysvsemaphore example
implementation:
/usr/src/sys/kern/sysv_sem.c