• Aucun résultat trouvé

Weak memory modelsIntel whitepaper (1/3)

N/A
N/A
Protected

Academic year: 2022

Partager "Weak memory modelsIntel whitepaper (1/3)"

Copied!
8
0
0

Texte intégral

(1)

Reductions and Causality (1)

jean-jacques.levy@inria.fr Tsinghua University,

October 31, 2011

http://pauillac.inria.fr/~levy/courses/tsinghua/reductions

Plan

independent statements

control flow

relaxed control flow

data dependencies

parallel processes

functional languages and multi-threading

Weak memory models

Intel whitepaper (1/3)

Demo1

(2)

Intel whitepaper (2/3)

Demo2

Intel whitepaper (3/3)

Demo3

Causality

Computations steps may be independent

Others are causally related

Refined to memory accesses

Theory of causality ?

- reductions steps in the λ-calculus (this course)

- event structures (processes)

- true concurrency

- slicing (program analysis)

- etc.

Intel 64 revisited (1/4)

In SC (sequentially consistent), program order is strictly respected

(3)

Intel 64 revisited (2/4)

Dependency relations

rf R is read from relation W

po B is program order A

ws W is write serialization (acyclic) relation W

R fr W is from read relation when there is W’ such that

rf R and

W’ W’ ws W

Intel 64 revisited (3/4)

In TSO, W followed by R can be relaxed within program order

Intel 64 revisited (4/4)

In TSO, W followed by R is relaxed

In PSO, W followed by W to distinct location is relaxed

WMM

(4)

WMM and optimization (1/2)

WMM and optimization (2/2)

[Vafeiadis, Zappa Nardelli] SAS/2010

Parallel computations

Pure functional languages (1/2)

Evaluations of subexpressions are independent

M M

1

M

2

· · · M

n

Evaluations of M and Mi can be done in parallel

No longer true if effects within some of Mi

-In Haskell, monads are the only effect-ful subterms

- monads may call pure functional terms

- pure functional terms cannot call monads

- effects are visible in types

In other languages, static analysis necessary to detect effects

(5)

Pure functional languages (2/2)

Inside functional languages, there exists dependencies

Evaluations in M has to be done before toplevel redex

M N ( x . P )Q P { x := Q }

I = x .x

where

I I (Ia) I (Ia) Ia

CCS or π -calculus (1/3)

Communications may be independent

but other transitions may be causally related

a 0 | b 1 | a(x).P | b(x ).Q

a 0 | a(x ).P | Q { x := 1 } b 1 | P { x := 0 } | b(x).Q

P { x := 0 } | Q { x := 1 }

[Jean Krivine] (reversible CCS)

CCS or π -calculus (2/3)

example of causally related transitions

a 0 | a(x ).b(y ).P | b 1

b(y).P { x := 0 } | b 1

P { x := 0, y := 1 }

causality in process algebras == event structures or Petri nets

causality in process algebras == event structures or Petri nets

« true concurrency »

[Winskel, Boudol-Castellani]

CCS or π -calculus (3/3)

possible conflicts

causality in process algebras == event structures or Petri nets

a 0 | b 1 | a(x ).P | a(y ).Q

b 1 | P { x := 0 } | a(y ).Q b 1 | a(x).P | Q { y := 0 }

#

(6)

Security

Non interference

Private and Public expressions

when P is public and M, N are private

C [M] P C [N ] P

Computations in M do not interfer on result P

[Volpano-Smith, Pottier-Simonet, Boudol]

... information flow

λ-calculus

Independent reductions (1/3)

In the λ-calculus, there are no conflicts (Church-Rosser thm)

M

N P

Q

Need closer look at reduction steps and notice when they can be permuted

(7)

Independent reductions (2/3)

permutation of reduction steps (nested redexes)

permutation of reduction steps (disjoint redexes)

( x .x (Ix ))(Ia) ( x .xx)(Ia) ( x.x(Ix ))a ( x.xx)a

( x .x (Ix ))(Ia) Ia (I (Ia))

( x .xx )(Ia) Ia (Ia)

Independent reductions (3/3)

problem: copies of redexes

( x.xx)(Ia) Ia (Ia) a (Ia)

( x .xx)a a a

how to define easily equivalence by permutations ?

Exercices

























Exercice

Show reductions equivalent by permutations in following reduction graph

(8)







 





































Show reductions equivalent by permutations in following reduction graph

Show reductions equivalent by permutations in following reduction graph

Références

Documents relatifs

The letter was from a law firm in New York, and the attorney’s name was Thomas Campbell who was writing a letter on behalf of the artist Mary Ellen Carroll and it was

Quite possibly: Although positive illusions might inhere in some sort of domain-specific cognitive substrate that could have been specifically shaped via natural selection, I believe

The tail of the CDF also shows that a few trackers are employed by a large number of applications, with less than 5% of the trackers in both Facebook and RenRen tracking more than

There is not a common vision of power and trust among the members of the net- work under study, what can show the different interests members have to be in this

Using quantitative methodology based on a survey sample made in 29 food companies that belong to a Brazilian food association, it was possible to statistically correlate

Title: Non-typhoidal Salmonella infections in pigs: a closer look at epidemiology, pathogenesis and control..

In figure 1, the arrest or gelation line extends deep into the unstable region, and arrest occurs as the spinodal decomposition process leads to a bicontinuous structure which

This paper will define ethical hacking, list some of the commonly use terms for attackers, provide a list of the standard services offered via ethical hacking to combat