by C.A.R. Hoare @ Queen's Univ
CACM 1978
Problems
|
|||||||||||||||||||||
Attempts
to find
|
|||||||||||||||||||||
Main
points
|
Grammar
|
Grammar
|
|||||||||||||
EX
|
Grammar
|
Grammar
|
|||||||||
Communication
occurs when
|
|||||||||
Synchronization:
Rendezvous
|
|||||||||
Read/Write fails when the peer process terminates |
Grammar
|
|||||||||
Guarded
command
|
|||||||||
Alternative
command
|
|||||||||
Repetitive
command
|
|||||||||
Example:
select (rdfds, wrfds, exfds, timeout) can't be simulated
|
In
parallel programming, coroutine is more fundamental program structure than
subroutine
|
|||||||||||||||||
Lots
of functions (coroutines) can be implemented by using the primitives suggested in
this paper:
|
Subroutine can be simulated by a parallel command: [subr::SUB
|| X::USER]
|
|||||||||||||||||
Note:
|
|||||||||||||||||
Recursive function can be partly simulated using multiple processes computing each level | |||||||||||||||||
Problems
and algorithm
|
This paper suggests I/O and messaging as a fundamental synchronization primitives. Hence synchroniztion between processes is essentially not necessary | |||
Monitor
can be simply implemented as a process:
|
Problem: implement a buffer process X between producer and consumer | |||
Producer to buffer: buffer ! data | |||
Consumer
to buffer: buffer ! more; buffer ? data
|
|||
Buffer
implementation
|
|||
Multiple producers and/or consumers are possible. New producer and/or consumer joining to the buffer should be handled appropriately |
Semaphore process shared by multiple processes | |
We don't need to make semaphore operation atomic. But they should be very fast | |
Joining and leaving processes are headache too |
Each philosopher as an process; each fork as an process | |
Philosopher -> fork: pickup or pushdown | |
No deadlock prevention in the algorithm of the paper |
Message passing for the communication between processes is uniformly used to solve various problems | |
As rendezvous is used as the only synchronization mechanism, performance could be poor | |
Processes are very dynamic in nature. They are created or destroyed and join or leave some closed group. Hence the language introduced in this paper should have had dynamic nature rather than static one as they claimed. This is why they couldn't fully implement recursions, monitor, semaphore, etc. And the language would have become a lot complex if they had made it dynamic. |