sem - V(sem), signal(sem) sem_getvalue (sem_t *sem, int...

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

View Full Document Right Arrow Icon
Semaphore Management #include <semaphore.h> sem_init (sem_t *sem, int pshared, unsigned int value) Initial a Semaphore sem_wait (sem_t *sem) P(sem), wait(sem) sem_post (sem_t *sem)
Background image of page 1

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

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

Unformatted text preview: V(sem), signal(sem) sem_getvalue (sem_t *sem, int *sval) get the value of sem sem_destroy (sem_t *sem) destroy sem Gcc pthread xx.c o abc ./abc...
View Full Document

Page1 / 2

sem - V(sem), signal(sem) sem_getvalue (sem_t *sem, int...

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

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