ZHAW-Logo OAPA-Logo TAT-Logo
zurück  
Diplomarbeit 2004 (DA04): Arbeits-Archiv
 
DA Frp 04/1 - Synchronisation of parallel processes using CSP
Studierende: Patrick Helfenstein, helfepat
  Pius Widmer, widmepiu

Betreuer: Peter T. Früh, frup
  Markus Thaler, tham

With the introduction of multiprocessing a few decades ago, a wealth of new possibilities for programmers has arisen. Although the benefits are numerous, there are also certain drawbacks to using this technique. Since more than one process with several threads each can run in parallel on the same processor, it is necessary to ensure a fair scheduling mechanism. The resources are shared between all running processes and must therefore be protected of simultaneous use by more than one process, lest the data may become inconsistent. Thus, the resources must be reserved before usage. This removes the threat of inconsistency but in another way makes matters even worse, for processes can now starve or deadlock under certain conditions. Mutex, Semaphore and Monitor are some concepts which were invented to reserve resources and allow different threads to synchronize their work. Unfortunately, deadlocks and race conditions can still not be prevented with absolute certainty.

With Communicating Sequential Processes by C. Hoare though, deadlock freedom is formally provable. Moreover, he created a semantics to define processes in a standardized way. Any CSP process is defined by its externally visible behaviour and its channels used for synchronization with other processes. No data is shared and the communication ability of any two processes among each other is limited to their shared channels. Processes can be put together to form a new, larger process in several different ways. The subprocesses of every system can be replaced with other subprocesses engaging in the same external behaviour. Furthermore the introduction of CSP into the world of OOP enables developers to discuss programs prior to their actual implementation solely in terms of process definition when hitherto, there was no common basis built on a widely accepted syntax. Similar to UML, complex problems can be explained quickly and unmisunderstandably, employing a shared vocabulary of CSP expressions.

zurück