|
Design Patterns: Actors |
|
- Smalltalk application designed called for ~20 independent Smalltalk processes
- Needed an interprocess communication mechanism
- Used Actors
- An Actor is
- A process which receives messages from a queue
- Queue is Process-safe, so many objects can write to it at once
- Actor process is the only process to read the queue
- Easy to implement - a BlockingQueue class which:
- uses a mutex Semaphore to read and write 'atomically'
- uses an event Semaphore to allow blocking read
- OrderedCollection to hold 'messages'