Beruflich Dokumente
Kultur Dokumente
Tiago Cogumbreiro
cogumbreiro@di.fc.ul.pt
Universidade de Lisboa
registers registers
instruction instruction
cache cache
Locks
Threads
Create α, r := newLock b
Create fork v
Acquire r := testSetLock v
Finish yield
Release unlock v
Environment
P fn(P)
[[P]]
x State
Messages
Processes
Translation of nil processes
[[0]] yield
Translation of nil processes
[[0]] yield
registers registers
[[0]] yield
Translation of output processes
Supporting Library
enqueue;yield
es
e ss
o c
pr
no
send
[[xhv i]] [[P{v /y }]]
reduce
Translation of parallel processes
registers registers
[[P | Q]] [[P]]
Supporting Library
enqueue;yield
s
ge
sa
es
m
no
receive
[[x(y ).P]] [[P{v /y }]]
reduce
Supporting library
s e n d [ a l p h a , t a u ] ( r 1 : tau ,
r 4 : ChannelType ( tau , a l p h a ) ,
r 5 : <l o c k ( a l p h a )>ˆ a l p h a ) {
−− s p i n l o c k t o a c q u i r e t h e g l o b a l l o c k a l p h a
r 2 := t s l S r 5
i f r2 = 0
−− a c q u i r e d t h e l o c k , unpack t h e c h a n n e l
jump sendUnpack [ t a u ] [ a l p h a ]
−− t r y a g a i n
jump s e n d [ t a u ] [ a l p h a ]
}
Trying to reduce
Thank you.
Any questions?