ch2 - Concurrency: processes & threads 1 ©Magee/Kramer...

Info iconThis preview shows pages 1–8. 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
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Concurrency: processes & threads 1 ©Magee/Kramer 2 nd Edition Chapter 2 Processes & Threads Concurrency: processes & threads 2 ©Magee/Kramer 2 nd Edition concurrent processes We s truc ture c o m ple x s ys te m s a s s e ts o f s im ple r a c tivitie s , e a c h re pre s e nte d a s a sequential process . Pro c e s s e s c a n o ve rla p o r b e c o nc urre nt, s o a s to re fle c t the c o nc urre nc y inhe re nt in the phys ic a l wo rld, o r to o fflo a d tim e - c o ns um ing ta s ks , o r to m a na g e c o m m unic a tio ns o r o the r de vic e s . De s ig ning c o nc urre nt s o ftwa re c a n b e c o m ple x a nd e rro r pro ne . A rig o ro us e ng ine e ring a ppro a c h is e s s e ntia l. Model processes as finite state machines. Program processes as threads in Java. Concept of a process as a sequence of actions. Concurrency: processes & threads 3 ©Magee/Kramer 2 nd Edition processes and threads Concepts : processes - units of sequential execution. Models : finite state processes (FSP) to model processes as sequences of actions. labelled transition systems (LTS) to analyse, display and animate behavior. Practice : Java threads Concurrency: processes & threads 4 ©Magee/Kramer 2 nd Edition 2.1 Modeling Processes Models are described using state machines, known as Labelled Transition Systems LTS . These are described textually as finite state processes ( FSP ) and displayed and analysed by the LTSA a na lys is to o l. ♦ LTS - g ra phic a l fo rm ♦ FS P - a lg e b ra ic fo rm Concurrency: processes & threads 5 ©Magee/Kramer 2 nd Edition modeling processes A process is the execution of a sequential program. It is modeled as a finite state machine which transits from state to state by executing a sequence of atomic actions. a light switch LTS on off on off on off ………. a s e q ue nc e o f a c tio ns o r trace on off 1 Can finite state models produce infinite traces? Concurrency: processes & threads 6 ©Magee/Kramer 2 nd Edition FSP - action prefix If x is a n a c tio n a nd P a pro c e s s the n (x-> P) de s c rib e s a pro c e s s tha t initia lly e ng a g e s in the a c tio n x a nd the n b e ha ve s e xa c tly a s de s c rib e d b y P . ONESHOT = (once -> STOP). O NES HO T s ta te m a c hine (te rm ina ting pro c e s s ) C o nve ntio n: a c tio ns b e g in with lo we rc a s e le tte rs PRO C ES S ES b e g in with uppe rc a s e le tte rs once 1 Concurrency: processes & threads 7 ©Magee/Kramer 2 nd Edition FSP - action prefix & recursion SWITCH = OFF, OFF = (on -> ON), ON = (off-> OFF)....
View Full Document

This note was uploaded on 02/08/2012 for the course CSCI 6232 taught by Professor Rotenstreich during the Spring '11 term at GWU.

Page1 / 36

ch2 - Concurrency: processes & threads 1 ©Magee/Kramer...

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

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