home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
aijournl
/
1986_09
/
cli.pdr
< prev
next >
Wrap
Text File
|
1986-06-07
|
1KB
|
32 lines
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)è