CS561 Computer Architecture Hye Yeon Kim

Slides:



Advertisements
Similar presentations
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Advertisements

3.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Process An operating system executes a variety of programs: Batch system.
COMMUNICATING SEQUENTIAL PROCESSES C. A. R. Hoare The Queen’s University Belfast, North Ireland.
Models of Concurrency Manna, Pnueli.
Concurrency CS 510: Programming Languages David Walker.
Ceng Operating Systems Chapter 2.1 : Processes Process concept Process scheduling Interprocess communication Deadlocks Threads.
Asynchronous Message Passing EE 524/CS 561 Wanliang Ma 03/08/2000.
A. Frank - P. Weisberg Operating Systems Introduction to Tasks/Threads.
1 Threads Chapter 4 Reading: 4.1,4.4, Process Characteristics l Unit of resource ownership - process is allocated: n a virtual address space to.
Threads Chapter 4. Modern Process & Thread –Process is an infrastructure in which execution takes place  (address space + resources) –Thread is a program.
Today’s Lecture Process model –initial & always statements Assignments –Continuous & procedural assignments Timing Control System tasks.
9/10/2015CS2104, Lecture 81 Programming Language Concepts, COSC Lecture 8 (Multiple) Threads Semantics.
Object Oriented Analysis & Design SDL Threads. Contents 2  Processes  Thread Concepts  Creating threads  Critical sections  Synchronizing threads.
Threading and Concurrency Issues ● Creating Threads ● In Java ● Subclassing Thread ● Implementing Runnable ● Synchronization ● Immutable ● Synchronized.
12/1/98 COP 4020 Programming Languages Parallel Programming in Ada and Java Gregory A. Riccardi Department of Computer Science Florida State University.
Definitions & Scenarios. Acknowledgements  This tutorial is based in part on Concurrency: State Models & Java Programming by Jeff Magee and Jeff Kramer.
1 Concurrent Languages – Part 1 COMP 640 Programming Languages.
Java Threads 11 Threading and Concurrent Programming in Java Introduction and Definitions D.W. Denbo Introduction and Definitions D.W. Denbo.
111 © 2002, Cisco Systems, Inc. All rights reserved.
COMPUTER PROGRAMMING. Functions What is a function? A function is a group of statements that is executed when it is called from some point of the program.
Copyright ©: University of Illinois CS 241 Staff1 Threads Systems Concepts.
© S. Ramesh / Kavi Arya / Krithi Ramamritham 1 IT-606 Embedded Systems (Software) S. Ramesh Kavi Arya Krithi Ramamritham KReSIT/ IIT Bombay.
CS333 Intro to Operating Systems Jonathan Walpole.
Multithreading in Java Sameer Singh Chauhan Lecturer, I. T. Dept., SVIT, Vasad.
15.1 Threads and Multi- threading Understanding threads and multi-threading In general, modern computers perform one task at a time It is often.
CS3773 Software Engineering Lecture 06 UML State Machines.
13-1 Chapter 13 Concurrency Topics Introduction Introduction to Subprogram-Level Concurrency Semaphores Monitors Message Passing Java Threads C# Threads.
Lecture 4 Introduction to Promela. Promela and Spin Promela - process meta language G. Holzmann, Bell Labs (Lucent) C-like language + concurrency dyamic.
Software Systems Verification and Validation Laboratory Assignment 4 Model checking Assignment date: Lab 4 Delivery date: Lab 4, 5.
Unit 4: Processes, Threads & Deadlocks June 2012 Kaplan University 1.
Testing Concurrent Programs Sri Teja Basava Arpit Sud CSCI 5535: Fundamentals of Programming Languages University of Colorado at Boulder Spring 2010.
pThread synchronization
TOPIC : SEQUENTIAL AND PARALLEL BLOCKS Module 2.3 : Behavioral modeling in verilog.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
Tutorial 2: Homework 1 and Project 1
Chapter 3: Process Concept
Background on the need for Synchronization
“Language Mechanism for Synchronization”
Operating Systems (CS 340 D)
Concurrency.
CS399 New Beginnings Jonathan Walpole.
Processes Overview: Process Concept Process Scheduling
Operating Systems (CS 340 D)
CGS 3763 Operating Systems Concepts Spring 2013
Thread synchronization
Inter-Process Communication and Synchronization
Lecture 2: Processes Part 1
Critical Section and Critical Resources
Chapter 3 Introduction to Classes, Objects Methods and Strings
Chapter 9 Classes: A Deeper Look, Part 1
Chapter 26 Concurrency and Thread
Critical Section and Critical Resources
CptS 561 Computer Architecture
Multithreading.
Midterm review: closed book multiple choice chapters 1 to 9
Threads Chapter 4.
Operating System Concepts
Lab 5 Process Control Operating System Lab.
Threads Chapter 4.
Concurrency: Mutual Exclusion and Process Synchronization
Chapter 3: Processes.
Java Concurrency.
CS510 Operating System Foundations
Java Concurrency.
Threads and Multithreading
Outline Chapter 2 (cont) Chapter 3: Processes Virtual machines
Chapter 3: Process Concept
EECE.4810/EECE.5730 Operating Systems
Chapter 3: Process Management
Presentation transcript:

CS561 Computer Architecture Hye Yeon Kim Concurrent Execution CS561 Computer Architecture Hye Yeon Kim

Chapter topics Processes Process creation represent independent threads of control, each of which executes sequential code. Process creation declaration Unabbreviated form of processes Concurrent invocation statement Process scheduling & priorities

Processes Declarations Processes in a resources or global are created when the resource or global is created. Processes are created as their declarations are encountered in executing the resource's or global’s initial code. (the initial code continues as soon as a process is created. It does not wait for the process to terminate.) For process declarations that contains quantifiers, one instance of the process is created for each combination of values of the bound variables.

Non- deterministic execution the order of the p1, p2 execution is not known write(“in p1”,x) # added to process p1 write (“in p2”,x) # added to process p2 The output from one write will not one interleaved with the output from the other.

Program with multiple processes terminates when all processes have terminated, a deadlock has occurred, or a stop statement is executed. Any final code in the main resource is then executed, and globals imported by the main resources are destroyed (unless a stop statement is executed with a non-zero exit status)

Unabbreviated form of processes When processes need to be created as a program executes, we can use unabbreviated forms. proc and send invocation has been abbreviated in process declaration. send: a asynchronous invocation (i.e. non-blocking) call: a synchronous invocation (i.e. blocking) a send does not wait for the invoked proc to return any results; it terminates immediately after passing the arguments to the proc. A new process is created to execute the proc; it executes in parallel with the process that executed send

Concurrent invocation without postprocessing code co p(3) // q() // a:= r(x,y) oc final invocation assigns the value that r returns to a. It terminates when all invocations terminates.

Concurrent invocation It consists of one or more concurrent commands separated by // delimiters: co concurrent_command // concurrent_command // ... oc Each concurrent command consists of an invocation and optional block of postprocessing code. Invocation or invocation -> block

Concurrent invocation with postprocessing code All invocations are first started in parallel. Then as each invocation terminates, the corresponding postprocessing block is executed, if there is one. Postprocessing blocks are executed one at a time; they are not executed concurrently and thus can change variables without requiring mutual exclusion.

Process scheduling & priorities setproirity function