home *** CD-ROM | disk | FTP | other *** search
-
- CLI LISP Synchronized Producer and Consumer Tasks
-
-
- PRODUCER - CONSUMER
- - empty the buffer
- - create a list of information for the example
- (could be read in)
- - initialize the semaphores
- ($ok-to-produce $ok-to-consume)
- - start the concurrent producer and consumer tasks
-
- PRODUCER
- - repeat until the information is exhausted
- - wait until the buffer is empty
- (using semaphore $ok-to-produce)
- (this suspends PRODUCER)
- - fill the buffer
- - signal that the buffer is full
- (using semaphore $ok-to-consume)
- (this wakes up CONSUMER)
-
- CONSUMER
- - repeat until the information is exhausted
- - wait until the buffer is full
- (using semaphore $ok-to-consume)
- (this suspends CONSUMER)
- - access the buffer
- - signal that the buffer is empty
- (using semaphore $ok-to-produce)
- (this wakes up PRODUCER)
-
-