02~Chapter_02 - Mutual Exclusion Companion slides for The...

Info iconThis preview shows pages 1–15. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Mutual Exclusion Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit Art of Multiprocessor Programming 2 Mutual Exclusion Today we will try to formalize our understanding of mutual exclusion We will also use the opportunity to show you how to argue about and prove various properties in an asynchronous concurrent setting Mutual Exclusion In his 1965 paper E. W. Dijkstra wrote: "Given in this paper is a solution to a problem which, to the knowledge of the author, has been an open question since at least 1962, irrespective of the solvability. [...] Although the setting of the problem might seem somewhat academic at first, the author trusts that anyone familiar with the logical problems that arise in computer coupling will appreciate the significance of the fact that this problem indeed can be solved." Art of Multiprocessor Programming 3 Art of Multiprocessor Programming 4 Mutual Exclusion Formal problem definitions Solutions for 2 threads Solutions for n threads Fair solutions Inherent costs Art of Multiprocessor Programming 5 Warning You will never use these protocols Get over it You are advised to understand them The same issues show up everywhere Except hidden and more complex Art of Multiprocessor Programming 6 Why is Concurrent Programming so Hard? Try preparing a seven-course banquet By yourself With one friend With twenty-seven friends Before we can talk about programs Need a language Describing time and concurrency Art of Multiprocessor Programming 7 Absolute, true and mathematical time, of itself and from its own nature, flows equably without relation to anything external. (I. Newton, 1689) Time is, like, Natures way of making sure that everything doesnt happen all at once. (Anonymous, circa 1968) Time time Art of Multiprocessor Programming 8 time An event a of thread A is Instantaneous No simultaneous events (break ties) a Events Art of Multiprocessor Programming 9 time A thread A is (formally) a sequence a , a 1 , ... of events Trace model Notation: a a 1 indicates order a Threads a 1 a 2 Art of Multiprocessor Programming 10 Assign to shared variable Assign to local variable Invoke method Return from method Lots of other things Example Thread Events Art of Multiprocessor Programming 11 Threads are State Machines Events are transitions a a 1 a 2 a 3 Art of Multiprocessor Programming 12 States Thread State Program counter Local variables System state Object fields (shared variables) Union of thread states Art of Multiprocessor Programming 13 time Thread A Concurrency Art of Multiprocessor Programming 14 time time Thread A Thread B Concurrency Art of Multiprocessor Programming...
View Full Document

Page1 / 158

02~Chapter_02 - Mutual Exclusion Companion slides for The...

This preview shows document pages 1 - 15. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online