Many Ways to Concur
Easy concurrency is one of the main prophesied benefits of the modern functional programming (FP) languages. But the implementation of concurrency differs widely between different FP languages. In this talk, we shall explore the methods and primitives of concurrency across three FP languages: Haskell, Erlang, and Clojure (with core.async).
We shall learn about and compare the trade-offs between
- the green threads and STM channels oriented concurrency of Haskell
- everything-is-a-process and message-passing actor pattern of Erlang
- macro-based CSP transformation of Clojure/core.async
Outline/Structure of the Talk
- Threads and Green Threads - 5 min
- OS threads as basics of concurrency
- Green threads as cheaper alternative to OS threads
- Locks, Channels and Messages - 5 min
- Inter-thread communication with shared memory
- Lock for synchronization
- Channels and messages as extension of locks
- Actor Model - 8 min
- What are Actors in Erlang
- Mailboxes and message passing
- Memory layout of actors
- Software Transactional Memory (STM) - 8 min
- What is STM in Haskell
- Blocking and retries in STM
- STM based channels
- State Machine Transformation - 8 min
- Deep walking macros in Clojure
- Transforming to Static single assignment form
- core.async channels
- Actor Model vs. CSP (Communicating Sequential Processes) - 5 min
- Q&A - 5 min
Learning Outcome
- Audience will learn and understand the various methods of implementing concurrency in functional programming languages.
- Audience will become familiar with pro and cons of different concurrency models.
- Audience will be able to make right choices when using FP for implementing concurrent programs.
Target Audience
People who are interested in learning and implementing concurrent programs in functional programming languages.
Prerequisites for Attendees
No prerequisites of knowing the languages used in the talk as this talk does not focus on language syntax much. However, the audience must have familiarity with the basics of concurrency primitives like threads, locks and schedulers.
Links
Some of the talks I've presented in past:
- Moving People with Clojure - EuroClojure 2017, Berlin
- Introduction to Concurrency in Haskell - Functional Conf 2015, Bangalore
- A Slow (and Hopefully Heedful) Ride Through ReactJS and Flux - JSFoo 2015, Bangalore
- A Quick (and Hopefully Painless) Ride Through ReactJS - Meta Refresh 2015, Bangalore
Some projects relevant to the proposal that I've worked on:
References for this talk:
schedule Submitted 2 years ago
People who liked this proposal, also liked:
-
keyboard_arrow_down
Srihari Sriraman - Generative Testing Patterns
45 Mins
Talk
Intermediate
Tests are good. Generative tests are better. But we don't write them often enough. Why not?
Generative testing isn't new; John Hughes' QuickCheck is now implemented in 30 languages. Yet, it is still not an every day tool for most software teams. Why not?
I have seen that maintaining a generative, or simulation testing suite can require the full-time attention of a few senior engineers. And over time, the tests become complex, brittle, ineffective, and hard to diagnose.
But isn't generative testing supposed to make testing simpler, and more effective?
I believe that it requires a rather different paradigm of thought from what we're used to with traditional testing. And recognising this paradigm shift can help us leverage it effectively.
I'll discuss a holistic perspective of generative testing to elucidate this thought paradigm.
Using a practical scenario, I'll discuss the patterns that emerge from this thinking, and how they address the concerns of making generative tests more effective, and maintainable. -
keyboard_arrow_down
Nitin Misra - Background Processing in Elixir with GenStage
45 Mins
Talk
Intermediate
We recently started working on a new Elixir project and had the need for a background processing system.
We decided to build our own background processing system in Elixir.
This talk describes why and how we built our own background processing system in Elixir.
How we use Elixir's GenStage package for adding back-pressure between the producer and consumer stages and how we add support for custom rate-limiting between several pipelines.
-
keyboard_arrow_down
Kiran Gangadharan / Udit Kumar - The Road to a Masterless Multi-node Distributed System in Elixir
45 Mins
Talk
Intermediate
In this talk, we will cover our journey from the base to the summit of a masterless multi-node distributed system in Elixir. We’ll talk about the challenges faced, decisions made and how they shaped/evolved the architecture.
-
keyboard_arrow_down
Govind Krishna Joshi - DSLs for Free
45 Mins
Case Study
Intermediate
DSLs allow us to express our code in verbs and nouns that describe our domain. This helps keeping business logic clean of implementation specific details, and allows for more readable code. Few languages have support for easily defining DSLs, for example macros in clojure/lisp, metaprogramming in ruby, but these techniques are not portable to other languages. Free monads is a way to convert a functor into monads, and allow us to create a structure for our desired computation, which can be interpreted later. This also allows us to decouple the definition of a DSL from its interpretation. In this talk we explore the use of Free monads to easily define DSLs and their interpreters.