CY2003 Computer Systems Lecture 7 Petri net. © LJMU, 2004CY2003- Week 72 Overview Petri net –concepts –Petri net representation –Firing a transition –Marks.

Slides:



Advertisements
Similar presentations
School of Computer Science & Software Engineering
Advertisements

Petri Net1 :Abstract formal model of information flow Major use: Modeling of systems of events in which it is possible for some events to occur concurrently,
1 SE-561 Formal Methods in Software Petri Nets - I.
An Introduction to Petri Nets
Principles of Engineering System Design Dr T Asokan
Introduction to Petri Nets Hugo Andrés López
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Petri Nets Section 2 Roohollah Abdipur.
Based on: Petri Nets and Industrial Applications: A Tutorial
6. Deadlocks 6.1 Deadlocks with Reusable and Consumable Resources
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 5: Process Synchronization.
IE 469 Manufacturing Systems
CY2003 Computer Systems Lecture 05 Semaphores - Theory.
Discrete Interaction Design Specification Prof. Dr. Matthias Rauterberg Faculty Industrial Design Technical University of Eindhoven
Synthesis of Embedded Software Using Free-Choice Petri Nets.
10. Petri Nets Prof. O. Nierstrasz. Roadmap  Definition: —places, transitions, inputs, outputs —firing enabled transitions  Modelling: —concurrency.
Petri Nets Overview 1 Definition of Petri Net C = ( P, T, I, O) Places P = { p 1, p 2, p 3, …, p n } Transitions T = { t 1, t 2, t 3, …, t n } Input.
Concurrent Processes Lecture 5. Introduction Modern operating systems can handle more than one process at a time System scheduler manages processes and.
CS 536 Spring Global Optimizations Lecture 23.
CP — Concurrent Programming 12. Petri Nets Prof. O. Nierstrasz Wintersemester 2005 / 2006.
1 Petri Nets H Plan: –Introduce basics of Petri Net models –Define notation and terminology used –Show examples of Petri Net models u Calaway Park model.
4/25/08Prof. Hilfinger CS164 Lecture 371 Global Optimization Lecture 37 (From notes by R. Bodik & G. Necula)
1 Petri Nets Marco Sgroi EE249 - Fall 2001 Most slides borrowed from Luciano Lavagno’s lecture ee249 (1998)
Prof. Fateman CS 164 Lecture 221 Global Optimization Lecture 22.
Petri Net Modeling for dynamic MM composite Object.
Mata kuliah :K0362/ Matematika Diskrit Tahun :2008
Prof. Bodik CS 164 Lecture 16, Fall Global Optimization Lecture 16.
Petri Nets An Overview IE 680 Presentation April 30, 2007 Renata Kopach- Konrad.
Chapter 3 : Software Process and Other Models Juthawut Chantharamalee Curriculum of Computer Science Faculty of Science and Technology, Suan Dusit University.
CY2003 Computer Systems Lecture 11 Review Lecture.
PETRINETS Nipun Devlekar Zauja Lahtau. PETRINETS DEFINITION : DEFINITION :  PETRINET (place/ transition net): a formal, graphical, executable technique.
Modeling with ordinary Petri Nets Events: Actions that take place in the system The occurrence of these events is controlled by the state of the system.
Hardware Design and The Petri Net Abhijit K. Deb SAM, LECS, IMIT, KTH Kista, Stockholm.
Petri Nets Lecturer: Roohollah Abdipour. Agenda Introduction Petri Net Modelling with Petri Net Analysis of Petri net 2.
CY2003 Computer Systems Lecture 04 Interprocess Communication.
Chapter 6 – Process Synchronisation (Pgs 225 – 267)
Modelling by Petri nets
CSCI1600: Embedded and Real Time Software Lecture 11: Modeling IV: Concurrency Steven Reiss, Fall 2015.
Deadlock Operating Systems: Internals and Design Principles.
School of Computer Science & Software Engineering
CAP 4800/CAP 5805: Computer Simulation Concepts
/faculteit technologie management PN-1 Petri nets refresher Prof.dr.ir. Wil van der Aalst Eindhoven University of Technology, Faculty of Technology Management,
Program Correctness. The designer of a distributed system has the responsibility of certifying the correctness of the system before users start using.
SOCSAMS e-learning Dept. of Computer Applications, MES College Marampally INTERPROCESS COMMUNICATION AND SYNCHRONIZATION SYNCHRONIZATION.
Operating System Concepts and Techniques Lecture 13 Interprocess communication-2 M. Naghibzadeh Reference M. Naghibzadeh, Operating System Concepts and.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 5: Process Synchronization.
CE Operating Systems Lecture 8 Process Scheduling continued and an introduction to process synchronisation.
Process Mining – Concepts and Algorithms Review of literature on process mining techniques for event log data.
Informationsteknologi Monday, October 1, 2007Computer Systems/Operating Systems - Class 111 Today’s class Deadlock.
Week 8 Computational Level
Laurea Triennale in Informatica – Corso di Ingegneria del Software I – A.A. 2006/2007 Andrea Polini VIII. Specifications (II)
Advantages of FSM Their simplicity make it easy for inexperienced developers to implement with little to no extra knowledge (low entry level)
Concurrent Systems Modeling using Petri Nets
Dr. Eng Amr T. Abdel-Hamid
Clockless Computing COMP
ITEC 202 Operating Systems
Week 8 Computational Level
143a discussion session week 3
CAP 4800/CAP 5805: Computer Simulation Concepts
CAP 4800/CAP 5805: Computer Simulation Concepts
CSCI1600: Embedded and Real Time Software
Introduction to Petri Nets (PNs)
Lecture 2 Part 2 Process Synchronization
Concurrency: Mutual Exclusion and Process Synchronization
CAP 4800/CAP 5805: Computer Simulation Concepts
Petri nets.
Petri Net :Abstract formal model of information flow Major use:
CSCI1600: Embedded and Real Time Software
Petri Nets Laurie Frazier.
Presentation transcript:

CY2003 Computer Systems Lecture 7 Petri net

© LJMU, 2004CY2003- Week 72 Overview Petri net –concepts –Petri net representation –Firing a transition –Marks (Tokens) Modeling with Petri net –Events and condition Mutual exclusion

Petri Net: Background

© LJMU, 2004CY2003- Week 74 Background A petri net was introduced by a German mathematician and used to model a system –Condition: a Boolean description of the state of the system –Event: an action that depends on the state of the system Petri net is a graphical and mathematical tools for the analysis of discrete event dynamic systems. –The system model is represented by a set of conditions and a set of events –A condition is represented by a place and an event by transition.

© LJMU, 2004CY2003- Week 75 Petri net representation In the graphical representation for a of petri net: –a place is drawn as a circle –a transition is drawn as a bar.

© LJMU, 2004CY2003- Week 76 Marks (Tokens) A marking M is an assignment of tokens (dots) to places of a petri net. Dots are placed in the circle to represent place in which its condition is satisfied –e.g. a resource is available or operation in a process The marking can be represented as M = (1,1,0)

© LJMU, 2004CY2003- Week 77 Marks (Tokens) A place can have more than one token and therefore can represent a queue –(e.g. a buffer holding several processes).

© LJMU, 2004CY2003- Week 78 Firing a transition Executing a marked Petri net causes the number and positions of the token to change. The rules for the execution are: –A transition is enabled if all its input places contain at least one token. –Any enabled transition may fire –Firing of a transition results in one token being removed from each of its input places and being deposited of its output places –Execution halts when there are no enabled transitions. –Each time a transitions fires, the marking of the petri net will change.

© LJMU, 2004CY2003- Week 79 Example

© LJMU, 2004CY2003- Week 710 Modelling with petri net Petri net is mainly used for modelling. –Many systems can be modelled by petri net. The system may be of many different kinds like computer hardware, computer software, physical system and so on. –Petri net is used to model the occurrence of various events and activities in the system.

© LJMU, 2004CY2003- Week 711 Concurrency and Synchronisation Concurrency means that two events could take place in parallel, without interfering with one another. –By having two places as input conditions to the same transition, these two conditions become synchronised.

© LJMU, 2004CY2003- Week 712 Conflict Two transitions t 1 and t 2 are said to be conflict if either t 1 or t 2 can occur but not both of them, –i.e., when there is one place that is acting as input condition to a number of transitions. –Therefore, only one transition can be fire.

Mutual exclusion

© LJMU, 2004CY2003- Week 714 Recall Mutual exclusion is a technique of defining entry and exit code so that at most one process is allowed to access the critical region at the same time. –The idea is that no process is allowed to enter the critical region, unless it checks that no other process is executing its own critical region. Mutual exclusion can be represented in Petri net using conflict.

© LJMU, 2004CY2003- Week 715 Mutual exclusion The place s represents the permission to enter the critical region and there must be token in p 1 and p 2. –If both processes want to enter the critical region simultaneously, then transition t 1 and t 2 are in conflict –i.e., only one of them can fire.

© LJMU, 2004CY2003- Week 716 Producer consumer problem bounded buffer

© LJMU, 2004CY2003- Week 717 Analysis of Petri net Petri nets are capable of modelling a large variety of systems and properly representing the interactions between the various actions which can occur. –The strength of Petri net is its capability to model the system. However, modelling by itself is of little use and its necessary to analyse the modelled system. This could lead to important insights into the behaviour of the modelled system.

© LJMU, 2004CY2003- Week 718 Reachibility Given a Petri net, one would like to know which marking M r can be reached from an initial marking M 0. Example: For the Petri net of the bounded buffer consumer producer problem, M 0 = (1, 0, 1, 0, 0, n) and M 1 = (0, 1, 1, 0, 0, n) –is immediately reachable from the marking of M 0.

© LJMU, 2004CY2003- Week 719 Safeness A place in a Petri net is save if the number of tokens in that place never exceeds one. – A petri net is same if all its places are safe. what does this Petri net do? Is it safe?

© LJMU, 2004CY2003- Week 720 Boundedness A place is k-safe or k-bounded if the number of tokens in that place cannot exceed an integer k. –Therefore a place is 1-bounded is simply a safe place. Example: –The Petri net for the producer/consumer problem with a bounded buffer, is it safe? Bounded? –The Petri net for the producer/consumer problem with a unbounded buffer, is it bounded? Why?

© LJMU, 2004CY2003- Week 721 Conservation A Petri net with an initial marking M 0, is strictly conservative, –if for all the reachable marking, the total number of tokens in each marking is exactly the same as the initial marking. A Petri net can be used to model resource allocation systems. In this systems some tokens may represents the resources. –Therefore, in such Petri nets conservation is an important property such that resources can neither be created nor destroyed.

© LJMU, 2004CY2003- Week 722 Liveness Another problem that could occur in resource allocation is deadlock. –A deadlock in a Petri net is a transition (or a set of transition) which cannot fire. –A transition is alive if it is not deadlock. –A transition is live in a marking M if it is potentially fireable in every marking in the Petri net.

© LJMU, 2004CY2003- Week 723 Exercises For the following Petri net, indicate whether each is bounded, live, and conservative or not and show why?

© LJMU, 2004CY2003- Week 724 Summary Petri net –concepts –Petri net representation –Firing a transition –Marks (Tokens) Modeling with Petri net –Events and condition Mutual exclusion