4 ms·
The way concurrency works is pretty unique amongst mainstream languages. Java has just copied some parts of how concurrency works in Go, but that's nearly 20 y
by adrianmsmith 3y ago
The way concurrency works is pretty unique amongst mainstream languages.
Java has just copied some parts of how concurrency works in Go, but that's nearly 20 years after Go was released.
It's extremely easy to start up code concurrently with "go foo()". You can start up lots of such functions concurrently, as it works in userspace. Like async code, but no "colored functions" problem.
- ildjarn 3y agoColored functions is only a problem in JS
- lokhura 3y agoAnd C#, Python, Rust...
- ildjarn 3y agoYou can de-color an async function by blocking.
- bheadmaster 3y agoIn most implementations, blocking in an async function has unintended side effect of blocking all other async function running on the same executor.
- neonsunset 3y agoIt's not the case in C#. It is discouraged, but mainly because there just used to be so much sloppily written async code that managed to bring down threadpool to its knees despite hillclimbing and blocked threads detection doing a lot of heavy lifting, so the community has grown scar tissue against this. It's rarely an issue if ever in the last 5 years or so.
- bheadmaster 3y agoAnd Python... And Rust... And C#...
- superdisk 3y agoThe concurrency model basically came from Erlang, which in my opinion does it better.
- pjmlp 3y agoActually Java brought back the green threads model that it had before Go came to be. The difference is that now red and green threads are exposed at the API level, and not an implementation detail. Hardly copying Go.
- bzzzt 3y ago> but that's nearly 20 years after Go was released. Go 1.0 was released in 2012.
- neonsunset 3y agoQuoting "colored functions" is a problem of skill. It is a tell of engineer's lack of understanding of concurrency.
- bheadmaster 3y agoCan you please elaborate why?