Multicore Programming

Slides:



Advertisements
Similar presentations
Universality of Consensus Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit.
Advertisements

HardBound: Architectural Support for Spatial Safety of the C Programming Language Joe Devietti *, Colin Blundell, Milo Martin, Steve Zdancewic * University.
Multicore Programming Skip list Tutorial 10 CS Spring 2010.
Universality of Consensus Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit.
The State Transition Diagram
Win8 on Intel Programming Course Desktop : Sensors Cédric Andreolli Intel Software
12. Common Errors, a few Puzzles. © O. Nierstrasz P2 — Common Errors, a few Puzzles 12.2 Common Errors, a few Puzzles Sources  Cay Horstmann, Computing.
Universality of Consensus The Art of Multiprocessor Programming Spring 2007.
EngageNY.org ©2012 Core Knowledge Foundation. This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Introduction Companion slides for
Spin Locks and Contention Based on slides by by Maurice Herlihy & Nir Shavit Tomer Gurevich.
Introduction to Software Engineering 7. Modeling Behaviour.
The Branching Storyboard Chapter 4.3 in Sketching the User Interface: The Workbook Image from:
12. Summary, Trends, Research. © O. Nierstrasz PS — Summary, Trends, Research Roadmap  Summary: —Trends in programming paradigms  Research:...
Shared Counters and Parallelism Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit.
ESE Einführung in Software Engineering N. XXX Prof. O. Nierstrasz Fall Semester 2009.
ESE Einführung in Software Engineering X. CHAPTER Prof. O. Nierstrasz Wintersemester 2005 / 2006.
Metamodeling Seminar X. CHAPTER Prof. O. Nierstrasz Spring Semester 2008.
ESE Einführung in Software Engineering X. CHAPTER Prof. O. Nierstrasz Wintersemester 2005 / 2006.
N. XXX Prof. O. Nierstrasz Thanks to Jens Palsberg and Tony Hosking for their kind permission to reuse and adapt the CS132 and CS502 lecture notes.
Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit Concurrent Skip Lists.
OORPT Object-Oriented Reengineering Patterns and Techniques X. CHAPTER Prof. O. Nierstrasz.
CP — Concurrent Programming X. CHAPTER Prof. O. Nierstrasz Wintersemester 2005 / 2006.
Art of Multiprocessor Programming 1 Universality of Consensus Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit.
12. eToys. © O. Nierstrasz PS — eToys 12.2 Denotational Semantics Overview:  … References:  …
SWOT Analysis Strengths Weaknesses SWOT Opportunities Threats.
Sequential Storyboards Chapter 4.1 in Sketching the User Interface: The Workbook Image from:
Two-Process Systems TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A AA Companion slides for Distributed Computing.
Collecting Images & Clippings Chapter 2.3 in Sketching User Experiences: The Workbook.
Win8 on Intel Programming Course The challenge Paul Guermonprez Intel Software
Computational Sprinting on a Hardware/Software Testbed Arun Raghavan *, Laurel Emurian *, Lei Shao #, Marios Papaefthymiou +, Kevin P. Pipe +#, Thomas.
Manifold Protocols TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A AA Companion slides for Distributed Computing.
© Copyright Showeet.com I NSERT YOUR TITLE HERE. © Copyright Showeet.com Insert Your Title Here 2 Master text styles –Second level Third level –Fourth.
Universality of Consensus and The Nature of Progress Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit.
The Animated Sequence Chapter 5.1 in Sketching User Experiences: The Workbook.
©2013 Core Knowledge Foundation. This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Sketching Vocabulary Chapter 3.4 in Sketching User Experiences: The Workbook Drawing objects, people, and their activities.
Win8 on Intel Programming Course Paul Guermonprez Intel Software
State of the Ward in 2007 Version 1.0 A Fifth Sunday Lesson Given in the Sterling Park Ward, Ashburn, VA Stake by D. Calvin Andrus, Bishop
Design of Everyday Things Part 2: Useful Designs? Lecture /slide deck produced by Saul Greenberg, University of Calgary, Canada Images from:
© 2014 Core Knowledge Foundation. This work is licensed under a Creative Commons Attribution- NonCommercial-ShareAlike 3.0 Unported License.
On Welfare Principles 5th Sunday Lesson Sterling Park Ward Ashburn, Virginia Stake Taught by: D. Calvin Andrus, Bishop and the Welfare Committee 29 March.
Concurrent Queues Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit.
Programming Language Basics Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit.
Multiprocessor Architecture Basics Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit.
Concurrent Stacks Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit.
Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit Concurrent Skip Lists.
The Narrative Storyboard Chapter 4.4 in Sketching User Experiences: The Workbook.
Images of pesticides By: Leslie London, University of Cape Town This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5.
An algorithm of Lock-free extensible hash table Yi Feng.
The Relative Power of Synchronization Operations Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit.
EngageNY.org ©2012 Core Knowledge Foundation. This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit Concurrent Skip Lists.
© 2015 Core Knowledge Foundation. This work is licensed under a Creative Commons Attribution- NonCommercial-ShareAlike 3.0 Unported License.
PHPBelgium – Belgian PHP community PHPBelgium event MVC = Make Venerated Code? Patrick Allaert.
1 Licence This presentation document is one used by Ryan Cartwright of Equitas IT Solutions [1] and is Copyright © 2008 Ryan P. Cartwright / Equitas IT.
Sketching Vocabulary Chapter 3.4 in Sketching User Experiences: The Workbook Drawing objects, people, and their activities.
Concurrent Objects Companion slides for
Methodology Overview 2 basics in user studies Lecture /slide deck produced by Saul Greenberg, University of Calgary, Canada Notice: some material in this.
Morning Reflections / Today’s objectives
Byzantine-Resilient Colorless Computaton
Pre and post workshop assessments
Elements of Combinatorial Topology
Universality of Consensus
FOTW Worksheet Slides Christopher Penn, Financial Aid Podcast Student Loan Network.
Simulations and Reductions
Universality of Consensus
Combinatorial Topology and Distributed Computing
Nir Shavit Multiprocessor Synchronization Spring 2003
Electronic resources in Rongo University college
Presentation transcript:

Multicore Programming Universal & Cache Tutorial 7 CS 0368-3469 Spring 2010

Summary Universal overview Universal questions Cache coherency - MESI

Theorem: Universality Consensus is universal From n-thread consensus build a Wait-free Linearizable n-threaded implementation Of any sequentially specified object Art of Multiprocessor Programming 3 3

Universal Application Part I public Response apply(Invoc invoc) { int i = ThreadID.get(); Node prefer = new node(invoc); while (prefer.seq == 0) { Node before = Node.max(head); Node after = before.decideNext.decide(prefer); before.next = after; after.seq = before.seq + 1; head[i] = after; } … Notice that the setting could be by a node other than the one whose method call the winning node represents. Art of Multiprocessor Programming 4 4

Universal Application Part II ... //compute my response SeqObject MyObject = new SeqObject(); current = tail.next; while (current != prefer){ MyObject.apply(current.invoc); current = current.next; } return MyObject.apply(current.invoc); To compute my response. Art of Multiprocessor Programming 5 5

Wait-Free Sliding Help Window while (announce[i].seq == 0) { Node before = head[i]; Node help = announce[(before.seq + 1 % n)]; if (help.seq == 0) prefer = help; else prefer = announce[i]; … Art of Multiprocessor Programming 6 6

Ptr to cell thread i wants to append Wait-free Construction Ptr to cell thread i wants to append … announce i tail 1 2 3 4 … head i Art of Multiprocessor Programming 7 7

Seq The dummy node at the tail of the list is initially set to 1. Which of the algorithms (wait/lock-free), would cease to work correctly if the sequence number of the dummy node was initially set to 0?

Art of Multiprocessor Programming Universal Object public class Universal { private Node[] head; private Node tail = new Node(); tail.seq = 1; for (int j=0; j < n; j++){ head[j] = tail } tail.seq = 0; Art of Multiprocessor Programming 9 9

Seq Solution Doesn't matter for Lock-Free Won't work for Wait-Free since the announce array is set to the tail.

wait-free universal construction In the wait-free universal construction If each thread first tries to append its own node, and then tries to help the other thread. Explain whether this alternative approach works.

Nondeterministic Propose a way to fix the universal construction to work for objects with nondeterministic sequential specifications.

Nondeterministic solution Replace with an equivalent deterministic object. Add another consensus object to each node, publishing the new state.

Headless solution Propose a way to avoid using distributed head. public class Universal { private Node[] head; private Node tail = new Node(); tail.seq = 1; for (int j=0; j < n; j++){ head[j] = tail }

Headless solution Replace the call of max() with : public Node last(Node tail){ Node prev = tail; Node current = prev.next; while(true){ if(current==null || current.seq==0)‏ return prev; prev = current; current = current.next; }

Bounded memory Propose a way to fix the universal construction to work with bounded of memory.

Bounded memory solution Add a “Garbage collection”. Update the tail reference to next node that all the heads passed.

Modified, Exclusive, Shared & Invalid MESI Modified, Exclusive, Shared & Invalid https://www.cs.tcd.ie/Jeremy.Jones/vivio/caches/MESIHelp.htm

MESI What is the advantages of distinguishing Exclusive and Modified? What is the advantages of distinguishing Exclusive and Shared?

Art of Multiprocessor Programming           This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License. You are free: to Share — to copy, distribute and transmit the work to Remix — to adapt the work Under the following conditions: Attribution. You must attribute the work to “The Art of Multiprocessor Programming” (but not in any way that suggests that the authors endorse you or your use of the work). Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under the same, similar or a compatible license. For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to http://creativecommons.org/licenses/by-sa/3.0/. Any of the above conditions can be waived if you get permission from the copyright holder. Nothing in this license impairs or restricts the author's moral rights. Art of Multiprocessor Programming 20 20