06svenss

Information about 06svenss

Published on December 3, 2007

Author: Elena

Source: authorstream.com

Content

Programming Distributed Erlang Applications: Pitfalls and Recipes + A More Accurate Semantics for Distributed Erlang:  Programming Distributed Erlang Applications: Pitfalls and Recipes + A More Accurate Semantics for Distributed Erlang Hans Svensson Chalmers University of Technology Lars-Åke Fredlund Universidad Politécnica de Madrid Erlang Workshop, Freiburg, 5 Oct. 2007 Two Papers One Talk!?:  Message passing guarantees Two Papers One Talk!? McErlang Pitfalls A More Accurate Semantics for Distributed Erlang A Semantics for Distributed Erlang Programming Distributed Erlang Applications: Pitfalls and Recipes Communication with dead processes Dropping messages Talking to the Dead:  Talking to the Dead N1 N2 P1 erlang:process_flag(trap_exit,true), Pid = spawn_link(N2,m,addTwo,[]), -module(m). addTwo()-> receive {Pid,Num} -> Pid ! Num + 2 end, addTwo(). Pid ! {self(),5}, receive N -> io:format(“~p\n”,[N]) end, 5+2 Talking to the Dead:  Talking to the Dead N1 N2 P1 receive {‘EXIT’,Pid,Reason} –> ok end, Talking to the Dead:  Talking to the Dead N1 N2 P1 -module(m2). mulTwo()-> receive {Pid,Num} -> Pid ! Num * 2 end, mulTwo(). Pid ! {self(),5}, receive N -> io:format(“~p\n”,[N]) end, 5*2 Behind the scene:  Behind the scene N2 was stopped and restarted A new process managed to get exactly the same pid Since the pid data structure is finite, this is expected, however… The magic number is 3! This ‘feature’ can not be modeled even in the more accurate semantics Losing messages:  Losing messages N1 P1 N2 P2 snd(Pid,N)-> Pid ! N, io:format(“~p “,[N]), timer:sleep(5000), snd(Pid,N+1). rcv()-> receive N -> io:format(“~p “,[N]), end, rcv(). 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 2 3 4 5 6 7 8 9 10 11 27 28 29 Behind the scene:  Behind the scene N1 and N2 was disconnected and later reconnected Easily discovered by using links Never rely on distributed communication without supervision This scenario can be correctly modeled in the improved semantics Distributed communication:  Distributed communication N1 P1 N2 P2 N3 P3 hello world world hello world world hello Distributed communication:  Distributed communication N1 P1 N2 P2 N3 P3 hello world world P3 hello world Behind the scene:  Behind the scene Only one (TCP-)connection between N1 and N2 A rather obscure guarantee Not recommended to exploit this guarantee in application, future runtime systems might break it This communication guarantee is not reflected in the semantics, there only the weaker guarantee holds Practical considerations:  Practical considerations There is always a difference between any model and the actual runtime system Artifacts of the OTP implementation of the runtime system should not be exploited Changes in the Semantics:  Changes in the Semantics New rules for node disconnect Simplified rules for node failure and restart A more compact formulation of fairness Properties of the distributed semantics Extension Message reordering and node disconnect Expressiveness Finite systems stays finite Survey!:  Survey! Summary:  Summary The possibility of reusing a Pid should not be neglected Distributed communication should always be supervised 3 is quite a small number, is it possible to use a larger number? A message from Lars-Åke:  A message from Lars-Åke He is at home, working on a new runtime system He has not figured out the complete semantics, yet! Erik Hello world! (or will it be World Hello!)

Related presentations


Other presentations created by Elena

Words
06. 12. 2007
0 views

Words

Cheryl Walker Literary Terms
05. 11. 2007
0 views

Cheryl Walker Literary Terms

Flame Pics 04 05
05. 11. 2007
0 views

Flame Pics 04 05

Storage tank Leak check 1
07. 11. 2007
0 views

Storage tank Leak check 1

mulkukarakus
22. 11. 2007
0 views

mulkukarakus

5para
23. 12. 2007
0 views

5para

From World War Two to Vietnam
24. 12. 2007
0 views

From World War Two to Vietnam

Burnswebversion
04. 01. 2008
0 views

Burnswebversion

9elKharrat
07. 01. 2008
0 views

9elKharrat

DesafioBibliotecaEsc olar
05. 11. 2007
0 views

DesafioBibliotecaEsc olar

group1
03. 01. 2008
0 views

group1

learning2004
16. 11. 2007
0 views

learning2004

Historizmus
01. 10. 2007
0 views

Historizmus

PUNJAB Sidhu
04. 10. 2007
0 views

PUNJAB Sidhu

Graciela Camara
04. 01. 2008
0 views

Graciela Camara

upwa6
01. 12. 2007
0 views

upwa6

Facilities Presentation CHE 4 02
04. 01. 2008
0 views

Facilities Presentation CHE 4 02

b689 w04
20. 02. 2008
0 views

b689 w04

prak astro
15. 11. 2007
0 views

prak astro

bfslides0708
24. 02. 2008
0 views

bfslides0708

alt2
29. 02. 2008
0 views

alt2

OCCAnalystsVisitNov01
12. 12. 2007
0 views

OCCAnalystsVisitNov01

04 05
05. 03. 2008
0 views

04 05

dgassnerFlexAjax360F lex
28. 11. 2007
0 views

dgassnerFlexAjax360F lex

PlanningDDivine
03. 10. 2007
0 views

PlanningDDivine

fiscalyear06a
27. 03. 2008
0 views

fiscalyear06a

Japan Spring 06
30. 03. 2008
0 views

Japan Spring 06

Old Faithful Premier Video
09. 10. 2007
0 views

Old Faithful Premier Video

eci147p3e
13. 04. 2008
0 views

eci147p3e

D5 Laura Botwinick Peter Angood
02. 10. 2007
0 views

D5 Laura Botwinick Peter Angood

family rel Qs 2004
28. 12. 2007
0 views

family rel Qs 2004

Shaxson
27. 12. 2007
0 views

Shaxson

WIC BFP Training Script
23. 11. 2007
0 views

WIC BFP Training Script

Vanhempainilta
05. 11. 2007
0 views

Vanhempainilta

OME CASEWRITING WORKSHOP
29. 12. 2007
0 views

OME CASEWRITING WORKSHOP

NASTIES AND BEASTIES THINGS1
19. 11. 2007
0 views

NASTIES AND BEASTIES THINGS1