Structured Thread Models Kahn Process Networks, CSP, Go 1Dennis Kafura – CS5204 – Operating Systems.

Slides:



Advertisements
Similar presentations
Multiple Processor Systems
Advertisements

Computer Science 320 Clumping in Parallel Java. Sequential vs Parallel Program Initial setup Execute the computation Clean up Initial setup Create a parallel.
Processes Management.
CHAPTER3 Higher-Level Synchronization and Communication
Claim Communicating Sequential Processes (CSP) A mathematical theory for specifying and verifying complex patterns of behaviour arising from interactions.
Programming in Occam-pi: A Tutorial By: Zain-ul-Abdin
Ch4. Processes Process Concept (1) new waiting terminate readyrunning admitted interrupt exit scheduler dispatch I/O or event completion.
Concurrency Important and difficult (Ada slides copied from Ed Schonberg)
Go Language * Go - Routines * Channels. New Concepts Do not communicate by sharing memory; instead, share memory by communicating. creating shared memory.
DATAFLOW PROCESS NETWORKS Edward A. Lee Thomas M. Parks.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Objectives Understand Process concept Process scheduling Creating.
A Message Passing Standard for MPP and Workstations Communications of the ACM, July 1996 J.J. Dongarra, S.W. Otto, M. Snir, and D.W. Walker.
Precept 3 COS 461. Concurrency is Useful Multi Processor/Core Multiple Inputs Don’t wait on slow devices.
Concurrency CS 510: Programming Languages David Walker.
CMPT 300: Operating Systems I Ch 3: Processes Dr. Mohamed Hefeeda
02/01/2010CSCI 315 Operating Systems Design1 Interprocess Communication Notice: The slides for this lecture have been largely based on those accompanying.
1/26/2007CSCI 315 Operating Systems Design1 Processes Notice: The slides for this lecture have been largely based on those accompanying the textbook Operating.
Interprocess Communication. Process Concepts Last class.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings 1.
A Message Passing Standard for MPP and Workstations Communications of the ACM, July 1996 J.J. Dongarra, S.W. Otto, M. Snir, and D.W. Walker.
Voicu Groza, 2008 SITE, HARDWARE/SOFTWARE CODESIGN OF EMBEDDED SYSTEMS Hardware/Software Codesign of Embedded Systems Voicu Groza SITE Hall, Room.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations.
Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication in Client-Server.
CS5204 – Operating Systems 1 Communicating Sequential Processes (CSP)
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Threads and Processes.
Operating Systems Part III: Process Management (Process States and Transitions)
Java Threads 11 Threading and Concurrent Programming in Java Introduction and Definitions D.W. Denbo Introduction and Definitions D.W. Denbo.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 4 Process Slide 1 Chapter 4 Process.
1 Lecture 5 (part2) : “Interprocess communication” n reasons for process cooperation n types of message passing n direct and indirect message passing n.
3.1 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 9 th Edition Interprocess Communication Processes within a system may be.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
Processes. Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication.
Threaded Programming in Python Adapted from Fundamentals of Python: From First Programs Through Data Structures CPE 401 / 601 Computer Network Systems.
CS212: OPERATING SYSTEM Lecture 2: Process 1. Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
Synchronization Methods in Message Passing Model.
Middleware Services. Functions of Middleware Encapsulation Protection Concurrent processing Communication Scheduling.
Processes CSCI 4534 Chapter 4. Introduction Early computer systems allowed one program to be executed at a time –The program had complete control of the.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-4 Process Communication Department of Computer Science and Software.
PREPARED BY : MAZHAR JAVED AWAN BSCS-III Process Communication & Threads 4 December 2015.
Operating Systems Yasir Kiani. 13-Sep Agenda for Today Review of previous lecture Interprocess communication (IPC) and process synchronization UNIX/Linux.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 4: Processes Process Concept Process Scheduling Operations on Processes Cooperating.
Washington WASHINGTON UNIVERSITY IN ST LOUIS Core Inter-Process Communication Mechanisms (Historically Important) Fred Kuhns
Concurrency & Context Switching Process Control Block What's in it and why? How is it used? Who sees it? 5 State Process Model State Labels. Causes of.
Problems with Semaphores Used for 2 independent purposes –Mutual exclusion –Condition synchronization Hard to get right –Small mistake easily leads to.
Processes. Process Concept Process Scheduling Operations on Processes Interprocess Communication Communication in Client-Server Systems.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
 Process Concept  Process Scheduling  Operations on Processes  Cooperating Processes  Interprocess Communication  Communication in Client-Server.
Communicating Sequential Processes (CSP) Ali Saoud.
High Performance Embedded Computing © 2007 Elsevier Lecture 4: Models of Computation Embedded Computing Systems Mikko Lipasti, adapted from M. Schulte.
Gokul Kishan CS8 1 Inter-Process Communication (IPC)
CSC 360, Instructor: Kui Wu IPC. CSC 360, Instructor: Kui Wu Agenda 1.The need to communicate 2.Shared memory 3.Message passing.
ASYNCHRONOUS AND DETERMINISTIC OBJECTS ASP: Asynchronous Sequential Processes l Distributed objects l Asynchronous method calls l Futures and Wait-by-necessity.
CS 311/350/550 Semaphores. Semaphores – General Idea Allows two or more concurrent threads to coordinate through signaling/waiting Has four main operations.
Threaded Programming in Python
CSE 775 – Distributed Objects Submitted by: Arpit Kothari
2. Specification and Modeling
12 Asynchronous Programming
A Message Passing Standard for MPP and Workstations
Process Description and Control
Process Description and Control
Threads and Concurrency
Typically for using the shared memory the processes should:
Why we have Counterintuitive Memory Models
Understanding Real-World Concurrency Bugs in Go
Concurrency in GO CS240 23/8/2017.
Asynchronous Programming CS Programming Languages for Web Applications
CS533 Concepts of Operating Systems Class 4
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Structured Thread Models Kahn Process Networks, CSP, Go 1Dennis Kafura – CS5204 – Operating Systems

Structured Threads Dennis Kafura – CS5204 – Operating Systems Kahn Process Network Deterministic Processes Unbounded FIFO channels Non-blocking writes, blocking reads 2 Note: figure from Wikipedia

Structured Threads CS 5204 – Operating Systems3 Communicating Sequential Processes (CSP) single thread of control autonomous encapsulated named static synchronous reliable unidirectional point­to­point fixed topology sequential process communication channel

Structured Threads Go Language go routine  Executed concurrently  No return value  Syntax: go list.sort() Channels  Typed  Specified bounds on channel capacity  Used for Return value(s) from go routine Communication with/among go routine(s)  Syntax ci := make(chan int) // unbuffered channel of integers cj := make(chan int, 0) // unbuffered channel of integers Ck := make (chan int, 100) //buffered channel of integers Dennis Kafura – CS5204 – Operating Systems4 See:

Structured Threads Go example Dennis Kafura – CS5204 – Operating Systems5 var sem = make(chan int, MaxOutstanding) func handle(r *Request) { sem <- 1 // Wait for active queue to drain. process(r) // May take a long time. <-sem // Done; enable next request to run. } func Serve(queue chan *Request) { for { req <-queue go handle(req) // Don't wait for handle to finish. }

Structured Threads Common Ideas Concurrency  Single threaded, deterministic processes  Non-determinism limited to interleaved execution of deterministic processes Interaction  Communication only via specified channels  no shared memory Unify communication and synchronization  Reads block when data unavailable  Write blocks if channel capacity exceeded or receiver not ready  Relates state of receiver to state of sender Dennis Kafura – CS5204 – Operating Systems6