Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Communicating Sequential Processes

Communicating Sequential Processes

Presented at Y Soft Technology Hour - http://www.meetup.com/ysoft-th/events/222006670/. Video available at https://www.youtube.com/watch?v=h7wxVsdsQPs

Jakub Fojtl

May 21, 2015
Tweet

More Decks by Jakub Fojtl

Other Decks in Programming

Transcript

  1. Agenda 1. The roots of CSP 2. Basic primitives of

    CSP 3. building more complex types from basic primitives
  2. Hoare 1978 “The traditional stored program digital computer has been

    designed primarily for deterministic execution of a single sequential program. Where the desire for greater speed has led to the introduction of parallelism, every attempt has been made to disguise this fact from the programmer.”
  3. Parallelisation? "AmdahlsLaw" by Daniels220 at English Wikipedia - Own work

    based on: File:AmdahlsLaw.png. Licensed under CC BY-SA 3.0 via Wikimedia Commons - http://commons.wikimedia.org/wiki/File:AmdahlsLaw.svg#/ media/File:AmdahlsLaw.svg Amdahl’s Law 1967
  4. Hoare 1978 “However, developments of processor technology suggest that a

    multiprocessor machine, constructed from a number of similar self-contained processors (each with its own store), may become more powerful, capacious, reliable, and economical than a machine which is disguised as a monoprocessor.”
  5. Hoare 1978 “Among the structuring methods for computer programs, three

    basic constructs have received widespread recognition and use: A repetitive construct (e.g. the while loop), an alternative construct (e.g. the conditional if..then..else), and normal sequential program composition (often denoted by a semicolon).”
  6. Hoare 1978 “This paper suggests that input and output are

    basic primitives of programming and that parallel composition of communicating sequential processes is a fundamental program structuring method.”
  7. Adoption among languages Addressable processes Erlang Message passing style of

    programming Unknown processes
 with channels OCaml, Go, Clojure
  8. Go in properties Statically, strongly typed supports duck typing compiles

    to native code, no VM the compilation is very fast runtime with garbage collector part of the final binary - you just carry one executable around Great for system programming, however marketed as a general purpose language Open Sourced, driven by Google, author - Rob Pike
  9. What have we learnt go routines are lightweight processes channels

    are a mean of synchronization unbuffered channels blocks on everything buffered channel blocks on read when empty blocks on write when full close, select, range
  10. So you want to try it? We hire :) -

    ysoft.jobs.com core.async in Clojure Java CSP Communicating scala objects