tuna project meeting york university 5 th . december, 2005

29
TUNA Project Meeting TUNA Project Meeting York University York University 5 5 th th . December, 2005 . December, 2005 occam-pi Multiway Sync occam-pi Multiway Sync Models Models Peter Welch (Kent Peter Welch (Kent University) University) (updated 12 (updated 12 th th . December, 2005) . December, 2005)

Upload: bruis

Post on 10-Feb-2016

63 views

Category:

Documents


0 download

DESCRIPTION

occam-pi Multiway Sync Models. Peter Welch (Kent University). TUNA Project Meeting York University 5 th . December, 2005. (updated 12 th . December, 2005). This looks at directly modeling Steve Schneider’s FDR script in occam-pi: clump1d2d3dtock-2005-12-06.fdr2. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: TUNA Project Meeting  York University  5 th . December, 2005

TUNA Project MeetingTUNA Project Meeting York University York University

5 5thth. December, 2005. December, 2005

occam-pi Multiway Sync Models occam-pi Multiway Sync Models

Peter Welch (Kent University) Peter Welch (Kent University)

(updated 12(updated 12thth. December, 2005). December, 2005)

Page 2: TUNA Project Meeting  York University  5 th . December, 2005

This looks at directly modeling Steve Schneider’s This looks at directly modeling Steve Schneider’s FDR script in occam-pi:FDR script in occam-pi:

clump1d2d3dtock-2005-12-06.fdr2clump1d2d3dtock-2005-12-06.fdr2

Page 3: TUNA Project Meeting  York University  5 th . December, 2005

A A CELLCELL process holds at most process holds at most oneone platelet and platelet and imposes a speed limit:imposes a speed limit:

channelchannel tock tock

channelchannel enterCell enterCell, , exitCellexitCell

CELLCELL = = enterCellenterCell -> -> tocktock -> -> FCELLFCELL [] [] tocktock -> -> CELLCELL

FCELLFCELL = = exitCellexitCell -> -> CELLCELL [] [] tocktock -> -> FCELLFCELL

channel channel pass pass : {0..N}: {0..N}

ACAC (i)(i) = { = {pass.ipass.i, , pass.i+1pass.i+1, , tocktock} }

LINELINE = || i:{0..N-1} @ [ = || i:{0..N-1} @ [ACAC (i)(i)] ] CC (i)(i)

CC (i)(i) = = CELLCELL [[ [[enterCellenterCell <- <- pass.ipass.i,, exitCellexitCell <- <- pass.i+1pass.i+1]]]]

Page 4: TUNA Project Meeting  York University  5 th . December, 2005

STICKABSTICKAB = = EMPTYAEMPTYA

EMPTYAEMPTYA = = enterAenterA -> -> ALMOSTAALMOSTA [] [] enterBenterB -> -> EMPTYAEMPTYA [] [] tocktock -> -> EMPTYAEMPTYA

ALMOSTAALMOSTA = = tocktock -> -> FULLAFULLA [] [] enterBenterB -> -> ALMOSTAALMOSTA [] [] exitAexitA -> -> EMPTYAEMPTYA

FULLAFULLA = = exitAexitA -> -> EMPTYAEMPTYA [] [] enterBenterB -> -> exitAexitA -> -> EMPTYAEMPTYA [] [] tocktock -> -> FULLAFULLA

channel channel enterAenterA, , exitAexitA, , enterBenterB

STICKYABSTICKYAB models the models the stickingsticking of one platelet to of one platelet to another:another:

delete this line and delete this line and we won’t need the we won’t need the CELLCELL processes! processes!

Page 5: TUNA Project Meeting  York University  5 th . December, 2005

AF (i)AF (i) = { = {pass.ipass.i, , pass.i+1pass.i+1, , pass.i+2pass.i+2, , tocktock} }

F (i)F (i) = = STICKYABSTICKYAB [[ [[enterAenterA <- <- pass.ipass.i,, exitAexitA <- <- pass.i+1pass.i+1,, enterBenterB <- <- pass.i+2pass.i+2]]]]

FSFS = || i:{0..N-2} @ [ = || i:{0..N-2} @ [AF (i)AF (i)] ] F (i)F (i)

SYS1DSYS1D = = LINELINE |{| |{|passpass, , tocktock|}| |}| FSFS

In 1-D, In 1-D, STICKYABSTICKYAB controls three adjacent cells controls three adjacent cells (where (where ““AA”” is cell is cell ““ii”” and and ““BB”” is cell is cell ““i+2i+2””):):

Page 6: TUNA Project Meeting  York University  5 th . December, 2005

What we are aiming for:What we are aiming for:

Page 7: TUNA Project Meeting  York University  5 th . December, 2005

PROC sticky.ab (ALT.BARRIER enter.a, exit.a,PROC sticky.ab (ALT.BARRIER enter.a, exit.a,

enter.b, tock)enter.b, tock)

::

STICKABSTICKAB = = EMPTYAEMPTYA

EMPTYAEMPTYA = = enterAenterA -> -> ALMOSTAALMOSTA [] [] enterBenterB -> -> EMPTYAEMPTYA [] [] tocktock -> -> EMPTYAEMPTYA

ALMOSTAALMOSTA = = tocktock -> -> FULLAFULLA [] [] enterBenterB -> -> ALMOSTAALMOSTA [] [] exitAexitA -> -> EMPTYAEMPTYA

FULLAFULLA = = exitAexitA -> -> EMPTYAEMPTYA [] [] enterBenterB -> -> exitAexitA -> -> EMPTYAEMPTYA [] [] tocktock -> -> FULLAFULLA

Page 8: TUNA Project Meeting  York University  5 th . December, 2005

PROC sticky.ab (ALT.BARRIER enter.a, exit.a,PROC sticky.ab (ALT.BARRIER enter.a, exit.a,

enter.b, tock)enter.b, tock)

VAL INT EMPTY.A IS 0:VAL INT EMPTY.A IS 0:

VAL INT ALMOST.A IS 1:VAL INT ALMOST.A IS 1:

VAL INT FULL.A IS 2:VAL INT FULL.A IS 2:

INITIAL INT state IS EMPTY.A:INITIAL INT state IS EMPTY.A:

::

STICKABSTICKAB = = EMPTYAEMPTYA

EMPTYAEMPTYA = = enterAenterA -> -> ALMOSTAALMOSTA [] [] enterBenterB -> -> EMPTYAEMPTYA [] [] tocktock -> -> EMPTYAEMPTYA

ALMOSTAALMOSTA = = tocktock -> -> FULLAFULLA [] [] enterBenterB -> -> ALMOSTAALMOSTA [] [] exitAexitA -> -> EMPTYAEMPTYA

FULLAFULLA = = exitAexitA -> -> EMPTYAEMPTYA [] [] enterBenterB -> -> exitAexitA -> -> EMPTYAEMPTYA [] [] tocktock -> -> FULLAFULLA

Page 9: TUNA Project Meeting  York University  5 th . December, 2005

PROC sticky.ab (ALT.BARRIER enter.a, exit.a,PROC sticky.ab (ALT.BARRIER enter.a, exit.a,

enter.b, tock)enter.b, tock)

VAL INT EMPTY.A IS 0:VAL INT EMPTY.A IS 0:

VAL INT ALMOST.A IS 1:VAL INT ALMOST.A IS 1:

VAL INT FULL.A IS 2:VAL INT FULL.A IS 2:

INITIAL INT state IS EMPTY.A:INITIAL INT state IS EMPTY.A:

WHILE TRUEWHILE TRUE

CASE stateCASE state

... EMPTY.A case... EMPTY.A case

... ALMOST.A case... ALMOST.A case

... FULL.A case... FULL.A case

::

STICKABSTICKAB = = EMPTYAEMPTYA

EMPTYAEMPTYA = = enterAenterA -> -> ALMOSTAALMOSTA [] [] enterBenterB -> -> EMPTYAEMPTYA [] [] tocktock -> -> EMPTYAEMPTYA

ALMOSTAALMOSTA = = tocktock -> -> FULLAFULLA [] [] enterBenterB -> -> ALMOSTAALMOSTA [] [] exitAexitA -> -> EMPTYAEMPTYA

FULLAFULLA = = exitAexitA -> -> EMPTYAEMPTYA [] [] enterBenterB -> -> exitAexitA -> -> EMPTYAEMPTYA [] [] tocktock -> -> FULLAFULLA

Page 10: TUNA Project Meeting  York University  5 th . December, 2005

{{{ FULL.A case{{{ FULL.A case

FULL.AFULL.A

ALTALT

SYNC exit.aSYNC exit.a

state := EMPTY.Astate := EMPTY.A

SYNC enter.bSYNC enter.b

SEQSEQ

SYNC exit.aSYNC exit.a

state := EMPTY.Astate := EMPTY.A

SYNC tockSYNC tock

SKIPSKIP

}}}}}}

FULLAFULLA = = exitAexitA -> -> EMPTYAEMPTYA [] [] enterBenterB -> -> exitAexitA -> -> EMPTYAEMPTYA [] [] tocktock -> -> FULLAFULLA

Page 11: TUNA Project Meeting  York University  5 th . December, 2005

What we can (just about) do:What we can (just about) do:

using the “oracle” process …using the “oracle” process …

Page 12: TUNA Project Meeting  York University  5 th . December, 2005

PROC sticky.ab (VAL INT id,PROC sticky.ab (VAL INT id,

VAL INT enter.a, exit.a, enter.b, tock,VAL INT enter.a, exit.a, enter.b, tock,

SHARED CHAN ALT.SYNC.START to.oracle!,SHARED CHAN ALT.SYNC.START to.oracle!,

CHAN ALT.SYNC.FINISH from.oracle?)CHAN ALT.SYNC.FINISH from.oracle?)

::

STICKABSTICKAB = = EMPTYAEMPTYA

EMPTYAEMPTYA = = enterAenterA -> -> ALMOSTAALMOSTA [] [] enterBenterB -> -> EMPTYAEMPTYA [] [] tocktock -> -> EMPTYAEMPTYA

ALMOSTAALMOSTA = = tocktock -> -> FULLAFULLA [] [] enterBenterB -> -> ALMOSTAALMOSTA [] [] exitAexitA -> -> EMPTYAEMPTYA

FULLAFULLA = = exitAexitA -> -> EMPTYAEMPTYA [] [] enterBenterB -> -> exitAexitA -> -> EMPTYAEMPTYA [] [] tocktock -> -> FULLAFULLA

Page 13: TUNA Project Meeting  York University  5 th . December, 2005

PROC sticky.ab (VAL INT id,PROC sticky.ab (VAL INT id,

VAL INT enter.a, exit.a, enter.b, tock,VAL INT enter.a, exit.a, enter.b, tock,

SHARED CHAN ALT.SYNC.START to.oracle!,SHARED CHAN ALT.SYNC.START to.oracle!,

CHAN ALT.SYNC.FINISH from.oracle?)CHAN ALT.SYNC.FINISH from.oracle?)

... VAL INT EMPTY.A, ALMOST.A, FULL.A... VAL INT EMPTY.A, ALMOST.A, FULL.A

... VAL OFFER emtpy.a, almost.a, full.a, full.a.b... VAL OFFER emtpy.a, almost.a, full.a, full.a.b

INITIAL INT state IS EMPTY.A:INITIAL INT state IS EMPTY.A:

::

STICKABSTICKAB = = EMPTYAEMPTYA

EMPTYAEMPTYA = = enterAenterA -> -> ALMOSTAALMOSTA [] [] enterBenterB -> -> EMPTYAEMPTYA [] [] tocktock -> -> EMPTYAEMPTYA

ALMOSTAALMOSTA = = tocktock -> -> FULLAFULLA [] [] enterBenterB -> -> ALMOSTAALMOSTA [] [] exitAexitA -> -> EMPTYAEMPTYA

FULLAFULLA = = exitAexitA -> -> EMPTYAEMPTYA [] [] enterBenterB -> -> exitAexitA -> -> EMPTYAEMPTYA [] [] tocktock -> -> FULLAFULLA

Page 14: TUNA Project Meeting  York University  5 th . December, 2005

PROC sticky.ab (VAL INT id,PROC sticky.ab (VAL INT id,

VAL INT enter.a, exit.a, enter.b, tock,VAL INT enter.a, exit.a, enter.b, tock,

SHARED CHAN ALT.SYNC.START to.oracle!,SHARED CHAN ALT.SYNC.START to.oracle!,

CHAN ALT.SYNC.FINISH from.oracle?)CHAN ALT.SYNC.FINISH from.oracle?)

... VAL INT EMPTY.A, ALMOST.A, FULL.A... VAL INT EMPTY.A, ALMOST.A, FULL.A

... VAL OFFER emtpy.a, almost.a, full.a, full.a.b... VAL OFFER emtpy.a, almost.a, full.a, full.a.b

INITIAL INT state IS EMPTY.A:INITIAL INT state IS EMPTY.A:

WHILE TRUEWHILE TRUE

CASE stateCASE state

... EMPTY.A case... EMPTY.A case

... ALMOST.A case... ALMOST.A case

... FULL.A case... FULL.A case

::

STICKABSTICKAB = = EMPTYAEMPTYA

EMPTYAEMPTYA = = enterAenterA -> -> ALMOSTAALMOSTA [] [] enterBenterB -> -> EMPTYAEMPTYA [] [] tocktock -> -> EMPTYAEMPTYA

ALMOSTAALMOSTA = = tocktock -> -> FULLAFULLA [] [] enterBenterB -> -> ALMOSTAALMOSTA [] [] exitAexitA -> -> EMPTYAEMPTYA

FULLAFULLA = = exitAexitA -> -> EMPTYAEMPTYA [] [] enterBenterB -> -> exitAexitA -> -> EMPTYAEMPTYA [] [] tocktock -> -> FULLAFULLA

Page 15: TUNA Project Meeting  York University  5 th . December, 2005

{{{ VAL OFFER emtpy.a, almost.a, full.a, full.a.b{{{ VAL OFFER emtpy.a, almost.a, full.a, full.a.b

VAL OFFER empty.a IS [enter.a, enter.b, tock]:VAL OFFER empty.a IS [enter.a, enter.b, tock]:

VAL OFFER almost.a IS [tock, enter.b, exit.a]:VAL OFFER almost.a IS [tock, enter.b, exit.a]:

VAL OFFER full.a IS [exit.a, enter.b, tock]:VAL OFFER full.a IS [exit.a, enter.b, tock]:

VAL OFFER full.a.b IS [exit.a]:VAL OFFER full.a.b IS [exit.a]:

}}}}}}

STICKABSTICKAB = = EMPTYAEMPTYA

EMPTYAEMPTYA = = enterAenterA -> -> ALMOSTAALMOSTA [] [] enterBenterB -> -> EMPTYAEMPTYA [] [] tocktock -> -> EMPTYAEMPTYA

ALMOSTAALMOSTA = = tocktock -> -> FULLAFULLA [] [] enterBenterB -> -> ALMOSTAALMOSTA [] [] exitAexitA -> -> EMPTYAEMPTYA

FULLAFULLA = = exitAexitA -> -> EMPTYAEMPTYA [] [] enterBenterB -> -> exitAexitA -> -> EMPTYAEMPTYA [] [] tocktock -> -> FULLAFULLA

Page 16: TUNA Project Meeting  York University  5 th . December, 2005

PROC sticky.ab (VAL INT id,PROC sticky.ab (VAL INT id,

VAL INT enter.a, exit.a, enter.b, tock,VAL INT enter.a, exit.a, enter.b, tock,

SHARED CHAN ALT.SYNC.START to.oracle!,SHARED CHAN ALT.SYNC.START to.oracle!,

CHAN ALT.SYNC.FINISH from.oracle?)CHAN ALT.SYNC.FINISH from.oracle?)

... VAL INT EMPTY.A, ALMOST.A, FULL.A... VAL INT EMPTY.A, ALMOST.A, FULL.A

... VAL OFFER emtpy.a, almost.a, full.a, full.a.b... VAL OFFER emtpy.a, almost.a, full.a, full.a.b

INITIAL INT state IS EMPTY.A:INITIAL INT state IS EMPTY.A:

WHILE TRUEWHILE TRUE

CASE stateCASE state

... EMPTY.A case... EMPTY.A case

... ALMOST.A case... ALMOST.A case

... FULL.A case... FULL.A case

::

STICKABSTICKAB = = EMPTYAEMPTYA

EMPTYAEMPTYA = = enterAenterA -> -> ALMOSTAALMOSTA [] [] enterBenterB -> -> EMPTYAEMPTYA [] [] tocktock -> -> EMPTYAEMPTYA

ALMOSTAALMOSTA = = tocktock -> -> FULLAFULLA [] [] enterBenterB -> -> ALMOSTAALMOSTA [] [] exitAexitA -> -> EMPTYAEMPTYA

FULLAFULLA = = exitAexitA -> -> EMPTYAEMPTYA [] [] enterBenterB -> -> exitAexitA -> -> EMPTYAEMPTYA [] [] tocktock -> -> FULLAFULLA

Page 17: TUNA Project Meeting  York University  5 th . December, 2005

{{{ FULL.A case{{{ FULL.A case

FULL.AFULL.A

INT result:INT result:

SEQSEQ

CLAIM to.oracle!CLAIM to.oracle!

to.oracle ! id; to.oracle ! id; full.afull.a

from.oracle ? result; from.oracle ? result; full.afull.a

CASE resultCASE result

... exit.a... exit.a

... enter.b... enter.b

... tock... tock

}}}}}}

[exit.a, enter.b, tock][exit.a, enter.b, tock]

FULLAFULLA = = exitAexitA -> -> EMPTYAEMPTYA [] [] enterBenterB -> -> exitAexitA -> -> EMPTYAEMPTYA [] [] tocktock -> -> FULLAFULLA

Page 18: TUNA Project Meeting  York University  5 th . December, 2005

{{{{{{ exit.aexit.a

exit.aexit.a

state := EMPTY.Astate := EMPTY.A

}}}}}}

{{{{{{ tocktock

tocktock

SKIPSKIP

}}}}}}

FULLAFULLA = = exitAexitA -> -> EMPTYAEMPTYA [] [] enterBenterB -> -> exitAexitA -> -> EMPTYAEMPTYA [] [] tocktock -> -> FULLAFULLA

Page 19: TUNA Project Meeting  York University  5 th . December, 2005

{{{ enter.b{{{ enter.b

enter.benter.b

SEQSEQ

CLAIM to.oracle!CLAIM to.oracle!

to.oracle ! id; full.a.bto.oracle ! id; full.a.b

from.oracle ? result; full.a.bfrom.oracle ? result; full.a.b

state := EMPTY.Astate := EMPTY.A

}}}}}}

[exit.a][exit.a]

exit.aexit.a

FULLAFULLA = = exitAexitA -> -> EMPTYAEMPTYA [] [] enterBenterB -> -> exitAexitA -> -> EMPTYAEMPTYA [] [] tocktock -> -> FULLAFULLA

Page 20: TUNA Project Meeting  York University  5 th . December, 2005

channelchannel tock tock

channelchannel enterCell enterCell, , exitCellexitCell

CELLCELL = = enterCellenterCell -> -> tocktock -> -> FCELLFCELL [] [] tocktock -> -> CELLCELL

FCELLFCELL = = exitCellexitCell -> -> CELLCELL [] [] tocktock -> -> FCELLFCELL

channel channel pass pass : {0..N}: {0..N}

ACAC (i)(i) = { = {pass.ipass.i, , pass.i+1pass.i+1, , tocktock} }

LINELINE = || i:{0..N-1} @ [ = || i:{0..N-1} @ [ACAC (i)(i)] ] CC (i)(i)

CC (i)(i) = = CELLCELL [[ [[enterCellenterCell <- <- pass.ipass.i,, exitCellexitCell <- <- pass.i+1pass.i+1]]]]

Let’s use the Let’s use the CELLCELL processes to synchronise processes to synchronise visualisation (after a visualisation (after a tocktock) of their state:) of their state:

Page 21: TUNA Project Meeting  York University  5 th . December, 2005

channelchannel tock tock

channelchannel enterCell enterCell, , exitCellexitCell

CELLCELL = = enterCellenterCell -> -> tocktock -> -> FCELLFCELL [] [] tocktock -> -> CELLCELL

FCELLFCELL = = exitCellexitCell -> -> CELLCELL [] [] tocktock -> -> FCELLFCELL

channel channel pass pass : {0..N}: {0..N}

ACAC (i)(i) = { = {pass.ipass.i, , pass.i+1pass.i+1, , tocktock} }

LINELINE = || i:{0..N-1} @ [ = || i:{0..N-1} @ [ACAC (i)(i)] ] CC (i)(i)

CC (i)(i) = = CELLCELL [[ [[enterCellenterCell <- <- pass.ipass.i,, exitCellexitCell <- <- pass.i+1pass.i+1]]]]

For each For each CELLCELL process, we add a process, we add a drawdraw event event which which alwaysalways follows a follows a tocktock::

Page 22: TUNA Project Meeting  York University  5 th . December, 2005

channelchannel tock tock,, drawdraw

channelchannel enterCell enterCell, , exitCellexitCell

CELLCELL = = enterCellenterCell -> -> tocktock -> -> drawdraw ->-> FCELLFCELL [] [] tocktock -> -> drawdraw ->-> CELLCELL

FCELLFCELL = = exitCellexitCell -> -> CELLCELL [] [] tocktock -> -> drawdraw ->-> FCELLFCELL

channel channel pass pass : {0..N}: {0..N}

ACAC (i)(i) = { = {pass.ipass.i, , pass.i+1pass.i+1, , tocktock,, drawdraw} }

LINELINE = || i:{0..N-1} @ [ = || i:{0..N-1} @ [ACAC (i)(i)] ] tocktock -> -> drawdraw ->-> CC (i)(i)

CC (i)(i) = = CELLCELL [[ [[enterCellenterCell <- <- pass.ipass.i,, exitCellexitCell <- <- pass.i+1pass.i+1]]]]

For each For each CELLCELL process, we add a process, we add a drawdraw event event which which alwaysalways follows a follows a tocktock::

Page 23: TUNA Project Meeting  York University  5 th . December, 2005

channelchannel tock tock,, drawdraw

channelchannel enterCell enterCell, , exitCellexitCell

CELLCELL = = enterCellenterCell -> -> tocktock -> -> drawdraw ->-> FCELLFCELL [] [] tocktock -> -> drawdraw ->-> CELLCELL

FCELLFCELL = = exitCellexitCell -> -> CELLCELL [] [] tocktock -> -> drawdraw ->-> FCELLFCELL

channel channel pass pass : {0..N}: {0..N}

ACAC (i)(i) = { = {pass.ipass.i, , pass.i+1pass.i+1, , tocktock,, drawdraw} }

LINELINE = || i:{0..N-1} @ [ = || i:{0..N-1} @ [ACAC (i)(i)] ] tocktock -> -> drawdraw ->-> CC (i)(i)

CC (i)(i) = = CELLCELL [[ [[enterCellenterCell <- <- pass.ipass.i,, exitCellexitCell <- <- pass.i+1pass.i+1]]]]

Visualisation will take place between a Visualisation will take place between a tocktock andand a a drawdraw – – when the cells can’t change statewhen the cells can’t change state::

Page 24: TUNA Project Meeting  York University  5 th . December, 2005

DISPLAYDISPLAY = ( = (tock ->tock -> RENDER_CELLSRENDER_CELLS); (); (drawdraw -> -> DISPLAYDISPLAY))

A A DISPLAYDISPLAY process also synchronises on process also synchronises on tocktock and and drawdraw, rendering the , rendering the fullfull or or emptyempty states of states of the cells in between:the cells in between:

RENDER_CELLSRENDER_CELLS = ... = ...

The The CELLCELL processes share processes share state variablesstate variables with with DISPLAYDISPLAY, which observes them only during , which observes them only during RENDER_CELLSRENDER_CELLS..

These These state variablesstate variables could be easily modeled as could be easily modeled as processes with processes with loadload and and storestore channels. channels.

Page 25: TUNA Project Meeting  York University  5 th . December, 2005

Note also that Note also that allall process process commitcommit to to the the drawdraw event – event – it is never offered as an option!it is never offered as an option!

channelchannel enterCell enterCell, , exitCellexitCell

CELLCELL = = enterCellenterCell -> -> tocktock -> -> drawdraw ->-> FCELLFCELL [] [] tocktock -> -> drawdraw ->-> CELLCELL

FCELLFCELL = = exitCellexitCell -> -> CELLCELL [] [] tocktock -> -> drawdraw ->-> FCELLFCELL

LINELINE = || i:{0..N-1} @ [ = || i:{0..N-1} @ [ACAC (i)(i)] ] tocktock -> -> drawdraw ->-> CC (i)(i)

CC (i)(i) = = CELLCELL [[ [[enterCellenterCell <- <- pass.ipass.i,, exitCellexitCell <- <- pass.i+1pass.i+1]]]]

DISPLAYDISPLAY = ( = (tock ->tock -> RENDER_CELLSRENDER_CELLS); (); (drawdraw -> -> DISPLAYDISPLAY))

Page 26: TUNA Project Meeting  York University  5 th . December, 2005

PROC cell (ALT.BARRIER enter, exit, tock,PROC cell (ALT.BARRIER enter, exit, tock,

BARRIER draw, BYTE pixel)BARRIER draw, BYTE pixel)

::

PROC cell (ALT.BARRIER enter, exit, tock,PROC cell (ALT.BARRIER enter, exit, tock,

BARRIER draw, BYTE pixel)BARRIER draw, BYTE pixel)

INITIAL BOOL empty IS TRUE:INITIAL BOOL empty IS TRUE:

SEQSEQ

pixel := empty.colourpixel := empty.colour

SYNC tockSYNC tock

SYNC drawSYNC draw

WHILE TRUEWHILE TRUE

IFIF

emptyempty

... empty... empty

TRUETRUE

... full... full

::

CELLCELL = = enterenter -> -> tocktock -> -> drawdraw ->-> FCELLFCELL [][] tocktock -> -> drawdraw ->-> CELLCELL

FCELLFCELL = = exitexit -> -> CELLCELL [] [] tocktock -> -> drawdraw ->-> FCELLFCELL

pixel rendering pixel rendering takes place takes place

between these between these SYNCSYNCss

Page 27: TUNA Project Meeting  York University  5 th . December, 2005

{{{ empty case{{{ empty case

ALTALT

SYNC enterSYNC enter

SEQSEQ

pixel := full.colourpixel := full.colour

empty := FALSEempty := FALSE

SYNC tockSYNC tock

SYNC drawSYNC draw

SYNC tockSYNC tock

SYNC drawSYNC draw

}}}}}}

pixel rendering pixel rendering takes place takes place

between these between these SYNCSYNCss

… … and between and between these these SYNCSYNCss

CELLCELL = = enterenter -> -> tocktock -> -> drawdraw ->-> FCELLFCELL [][] tocktock -> -> drawdraw ->-> CELLCELL

FCELLFCELL = = exitexit -> -> CELLCELL [] [] tocktock -> -> drawdraw ->-> FCELLFCELL

Page 28: TUNA Project Meeting  York University  5 th . December, 2005

{{{ full case{{{ full case

ALTALT

SYNC exitSYNC exit

SEQSEQ

pixel := empty.colourpixel := empty.colour

empty := TRUEempty := TRUE

SYNC tockSYNC tock

SYNC drawSYNC draw

}}}}}}

pixel rendering pixel rendering takes place takes place

between these between these SYNCSYNCss

CELLCELL = = enterenter -> -> tocktock -> -> drawdraw ->-> FCELLFCELL [][] tocktock -> -> drawdraw ->-> CELLCELL

FCELLFCELL = = exitexit -> -> CELLCELL [] [] tocktock -> -> drawdraw ->-> FCELLFCELL

Page 29: TUNA Project Meeting  York University  5 th . December, 2005

Alternatively, we could equip eachAlternatively, we could equip each CELLCELL process process with a with a drawingdrawing channel to which it would output its channel to which it would output its state (if changed) immediately following astate (if changed) immediately following a tocktock..

TheThe DISPLAYDISPLAY process could then monitor theprocess could then monitor the drawingdrawing channels and promise to channels and promise to serviceservice them – i.e. always them – i.e. always accept them. It would not have to engage with accept them. It would not have to engage with tocktock..

Many other scenarios for visualisation are Many other scenarios for visualisation are possible …possible …

The described method of giving each The described method of giving each CELLCELL process process direct access to the pixel used for rendering may be direct access to the pixel used for rendering may be the most efficient.the most efficient.