1/19 Distributed Programming using Role-Parametric Session Types in Go David Castro 1 , Raymond Hu 1 , Sung-Shik Jongmans 1,2 , Nicholas Ng 1 , Nobuko Yoshida 1 1 Imperial College London 2 Open University of the Netherlands
1/19 Distributed Programming using Role-Parametric Session Types in Go David Castro 1 , Raymond Hu 1 , Sung-Shik Jongmans 1,2 , Nicholas Ng 1 , Nobuko Yoshida 1 1 Imperial College London 2 Open University of the Netherlands
1/19 Distributed Programming using Role-Parametric Session Types in Go David Castro 1 , Raymond Hu 1 , Sung-Shik Jongmans 1,2 , Nicholas Ng 1 , Nobuko Yoshida 1 1 Imperial College London 2 Open University of the Netherlands
2/19 Introduction (distributed programming in Go) Long-term research agenda: Development of theory and tools to help programmers write safe concurrent programs
2/19 Introduction (distributed programming in Go) Long-term research agenda: Development of theory and tools to help Go programmers write safe concurrent Go programs [CC’16, POPL’17, ICSE’18]
3/19 Introduction (distributed programming in Go) (a) Modern, popular systems language
3/19 Introduction (distributed programming in Go) (a) Modern, popular systems language (b) Primacy of CSP-based concurrency features Lightweight threads, called goroutines Higher-order, typed native channels (across shared memory) First-order, untyped API channels (across a network)
3/19 Introduction (distributed programming in Go) (a) Modern, popular systems language (b) Primacy of CSP-based concurrency features Lightweight threads, called goroutines Higher-order, typed native channels (across shared memory) First-order, untyped API channels (across a network) (c) Survey: “Users least agreed that they are able to effectively debug uses of Go’s concurrency features”
3/19 m u l t i p a r t y Introduction (distributed programming in Go) s e s s i o n t y p e s ? [ P O P L ’ 0 8 ] (a) Modern, popular systems language (b) Primacy of CSP-based concurrency features Lightweight threads, called goroutines Higher-order, typed native channels (across shared memory) First-order, untyped API channels (across a network) (c) Survey: “Users least agreed that they are able to effectively debug uses of Go’s concurrency features”
4/19 Introduction (distributed programming in Go) Motivating example: htcat ( https://github.com/htcat/htcat ) Parallel downloader of webpages Post-factum verification very difficult Our safe-by-construction version: PGet ( )
5/19 Introduction (distributed programming in Go) Master M Fetchers F 1 F 2 F n Server S
5/19 f e a t u r e 1 : Introduction (distributed programming in Go) p a r a m e t e r i s a t i o n ( i n # F e t c h e r s ) Master M Fetchers F 1 F 2 F n Server S
5/19 f e a t u r e 1 : Introduction (distributed programming in Go) p a r a m e t e r i s a t i o n ( i n # F e t c h e r s ) Local Master M Fetchers F 1 F 2 F n Remote Server S shared memory channel TCP channel
5/19 f e a t u r e e 1 2 : t u r : f e a Introduction (distributed programming in Go) p a r a m e t e o r t s r i s n a s p t r a t i o n i x e d m ( i n # F e e t c h a e r a t d i s p r s ) & Local Master s t i o n M t r a c a b s Fetchers F 1 F 2 F n Remote Server S shared memory channel TCP channel
5/19 f e a t u r e e 1 2 : t u r : f e a Introduction (distributed programming in Go) p a r a m e t e o r t s r i s n a s p t r a t i o n i x e d m ( i n # F e e t c h a e r a t d i s p r s ) & Local Master s t i o n M t r a c a b s Fetchers F 1 F 2 F n Remote Server S M → F 1 : : :GetSize(string)
5/19 f e a t u r e e 1 2 : t u r : f e a Introduction (distributed programming in Go) p a r a m e t e o r t s r i s n a s p t r a t i o n i x e d m ( i n # F e e t c h a e r a t d i s p r s ) & Local Master s t i o n M t r a c a b s Fetchers F 1 F 2 F n Remote Server S F 1 → S: : :HttpReq(byte[])
5/19 f e a t u r e e 1 2 : t u r : f e a Introduction (distributed programming in Go) p a r a m e t e o r t s r i s n a s p t r a t i o n i x e d m ( i n # F e e t c h a e r a t d i s p r s ) & Local Master s t i o n M t r a c a b s Fetchers F 1 F 2 F n Remote Server S F 1 → S: . S → F 1 : : :HttpReq(byte[]). . : :HttpRes(byte[])
5/19 f e a t u r e e 1 2 : t u r : f e a Introduction (distributed programming in Go) p a r a m e t e o r t s r i s n a s p t r a t i o n i x e d m ( i n # F e e t c h a e r a t d i s p r s ) & Local Master s t i o n M t r a c a b s Fetchers F 1 F 2 F n Remote Server S F 1 → M: : :Size(int)
5/19 f e a t u r e e 1 2 : t u r : f e a Introduction (distributed programming in Go) p a r a m e t e o r t s r i s n a s p t r a t i o n i x e d m ( i n # F e e t c h a e r a t d i s p r s ) & Local Master s t i o n M t r a c a b s Fetchers F 1 F 2 F n Remote Server S M → F [ 1. .n ] : : :GetData(string,int,int)
5/19 f e a t u r e e 1 2 : t u r : f e a Introduction (distributed programming in Go) p a r a m e t e o r t s r i s n a s p t r a t i o n i x e d m ( i n # F e e t c h a e r a t d i s p r s ) & Local Master s t i o n M t r a c a b s Fetchers F 1 F 2 F n Remote Server S F [ 1. .n ] → S: : :HttpReq(byte[])
5/19 f e a t u r e e 1 2 : t u r : f e a Introduction (distributed programming in Go) p a r a m e t e o r t s r i s n a s p t r a t i o n i x e d m ( i n # F e e t c h a e r a t d i s p r s ) & Local Master s t i o n M t r a c a b s Fetchers F 1 F 2 F n Remote Server S F [ 1. .n ] → S: . S → F [ 1. .n ] : : :HttpReq(byte[]). . : :HttpRes(byte[])
5/19 f e a t u r e e 1 2 : t u r : f e a Introduction (distributed programming in Go) p a r a m e t e o r t s r i s n a s p t r a t i o n i x e d m ( i n # F e e t c h a e r a t d i s p r s ) & Local Master s t i o n M t r a c a b s Fetchers F 1 F 2 F n Remote Server S F [ 1. .n ] → M: : :Data(string,chan chan chan)
5/19 f e a t u r e e 1 2 : t u r : f e a Introduction (distributed programming in Go) p a r a m e t e o r t s r i s n a s p t r a t i o n i x e d m ( i n # F e e t c h a e r a t d i s p r s ) & Local Master s t i o n M t r a c a b s Fetchers F 1 F 2 F n Remote Server S F [ 1. .n ] → M: : :Data(string,chan chan chan)
5/19 f e a t u r e e 1 2 : t u r : f e a Introduction (distributed programming in Go) p a r a m e t e o r t s r i s n a s p t r a t i o n i x e d m feature 3: ( i n # F e e t c h a e r a t d i s p r s ) & channel passing Local Master s t i o n M t r a c a b s Fetchers F 1 F 2 F n Remote Server S F [ 1. .n ] → M: : :Data(string,chan chan chan)
5/19 f e a t u r e e 1 2 : t u r : f e a Introduction (distributed programming in Go) p a r a m e t e o r t s r i s n a s p t r a t i o n i x e d m feature 3: ( i n # F e e t c h a e r a t d i s p r s ) & channel passing Local Master s t i o n M t r a c a b s Fetchers F 1 F 2 F n Remote Server S
5/19 f e a t u r e e 1 2 : t u r : f e a Introduction (distributed programming in Go) p a r a m e t e o r t s r i s n a s p t r a t i o n i x e d m feature 3: f e a t u r e 4 : ( i n # F e e t c h a e r a t d i s p r s ) & channel passing h e t e r o g e n e o Local u s Master s t i o n M t r a c a b s r o l e s Fetchers F 1 F 1 F 2 F n Remote Server S
6/19 Introduction (distributed programming in Go) Features: Parameterisation (in #Fetchers) Mixed transports & disparate abstractions Channel passing Heterogeneous roles
6/19 Introduction (distributed programming in Go) Features: Parameterisation (in #Fetchers) Mixed transports & disparate abstractions Channel passing Heterogeneous roles Challenges ( safety ): Protocol compliance Deadlock-freedom
6/19 Introduction (distributed programming in Go) Features: Parameterisation (in #Fetchers) Mixed transports & disparate abstractions Channel passing Heterogeneous roles multiparty session types: Challenges ( safety ): Protocol compliance � Deadlock-freedom �
Recommend
More recommend