While I was playing with primitive Java threadpool, the world seems to have moved on to such wonderful constructs. https://t.co/YT5u8P0j5l— Deepak (@deepakvadgama) November 25, 2018
Recently I have been exploring concurrency features of other languages with fascination. It started with go co-routines, and then I discovered articles by Nathaniel Smith - creator of Python Trio library for concurrency - which piqued my interest to 11.
Concurrency using message passing (as opposed to memory sharing) is an utterly beautiful paradigm. It will soon become relevant to Java developers with Project Loom aka Java Fibers aka light-weight threads in Java.
I recommend these related articles which I found most helpful
go concurrency patterns - This was my first introduction to co-routines. Pure elegance.
CSP paper - This paper was the foundation of co-routines in go.
Timeouts and cancellation for humans - How timeouts should be implemented in IO libaries and extended to use cancellation tokens.
Notes on Structured Concurrency - Once you grasp concept of goroutines, this article is a must read. It addresses pitfalls of goroutines. This was also a reference for Kotlin’s coroutine implementation. I have never read such clear explanation of such difficult topic before.
Python Trio concurrency library - Introduction to Python’s Trio library (which uses structured concurrency) by its creator Nathaniel Smith.
What color is your function? - After promises/futures and rx libraries, async-await is the newest tool being added in many languages. This article explores how some languages force developers to label asynchronous functions all they way up the call stack.
In addition to coroutines, there are some features I plan to explore soon
Borrow Checker (Rust) - How Rust enforces variable ownership/lifetimes at compile time, in effect making language safer at runtime.
yeid/generator functions (Dart/Kotlin) - Functions that generate asynchronous streams of values.
Dispatchers (Kotlin) - Choosing the pool/thread where the async function runs/returns. More useful for Android/JS with single UI thread I think.
If you have any similar recommendations please let me know in the comments.