Presentation is loading. Please wait.

Presentation is loading. Please wait.

Concurrent and Distributed Systems Introduction to CET306 Harry R. Erwin, PhD University of Sunderland.

Similar presentations


Presentation on theme: "Concurrent and Distributed Systems Introduction to CET306 Harry R. Erwin, PhD University of Sunderland."— Presentation transcript:

1 Concurrent and Distributed Systems Introduction to CET306 Harry R. Erwin, PhD University of Sunderland

2 Texts Clay Breshears (2009) The Art of Concurrency: A Thread Monkey's Guide to Writing Parallel Applications, O'Reilly Media, Pages: 304. This is available on as a paperback and more cheaply as a Kindle edition. You don't need a Kindle to read a Kindle edition. Mordechai Ben-Ari (2006) Principles of Concurrent and Distributed Programming, Addison-Wesley. Also available on This is available as a paperback only. Covers the theory in depth and will be used as a supplementary text.www.amazon.co.uk

3 Basic Definitions Concurrent Program—a set of sequential programs that can be executed in parallel (Ben-Ari). This should be thought of as abstract parallelism. A Process is one of the sequential programs. A Thread is a programming construct corresponding to a Process. Distributed Program—a concurrent program that runs on separate computers and uses separate memory for each process. Parallel Program—a concurrent program that runs on separate processors, but shares memory or data among processes.

4 More Definitions Multitasking—when the execution of programs overlap on a single computer or CPU. This is a central function of the kernel of a modern operating system. Multithreading—when a program contains multiple threads or processes on a single computer or CPU. Task—another term for a schedulable entity or process. Tasks are commonly used in real-time systems to represent individual units of work. Multitasking or multithreading systems often interleave instructions on a CPU. This makes analysis of their correctness quite difficult.

5 Example of Interleaving There are six ways these processes can inter- leave: 1.p1; p2; q1; q2; 2.p1; q1; p2; q2; 3.p1; q1; q2; p2; 4.q1; q2; p1; p2; 5.q1; p1; q2; p2; 6.q1; p1; p2; q2; Your concurrent pro- gram MUST run cor- rectly in all six cases. Consider a concurrent program with two processes: Process 1: {p1; p2;} Process 2: {q1; q2;} Where pn; and qn; are atomic operations.

6 Why is Concurrent Programming Hard? Concurrent and distributed programs cannot be ‘hacked together’. Formal methods must be used to design them. You must synchronise the execution of processes, and their communication. This has to be thought through carefully. Illustration: In , TRW successfully built a high performance multi-tasking system for an important defence application. The application programmers on the project, including many of the world’s best at the time, were not trusted to implement concurrency correctly. The concurrency abstractions were allocated to the real-time operating system. We developed a ‘process design’ around those abstractions and an automated operating system test program to verify the correct implementation of the concurrency abstractions.


Download ppt "Concurrent and Distributed Systems Introduction to CET306 Harry R. Erwin, PhD University of Sunderland."

Similar presentations


Ads by Google