[HN Gopher] Structured Concurrency
___________________________________________________________________
Structured Concurrency
Author : pcr910303
Score : 23 points
Date : 2022-03-18 11:51 UTC (1 days ago)
(HTM) web link (250bpm.com)
(TXT) w3m dump (250bpm.com)
| ghoward wrote:
| Just so you know, those of us who believe in structured
| concurrency often have slightly different meanings (which I
| believe will converge over time). My definition is at [0].
|
| Beyond libdill, a rough version has now been implemented in C.
| (By me, sorry for shilling.)
|
| An example of it in code is at [1].
|
| Combine it with something I call a stackpool (basically a heap-
| allocated replacement for `alloca()`), and you can worry very
| little about managing memory manually, even in C.
|
| In fact, both together can even serve the same purpose as Rust's
| borrow checker in C, if you are willing to write your code with a
| certain style.
|
| Once I implement it as a first-class construct in a language
| (which I'm doing right now), it will look like this:
| threadset { // This starts a thread.
| go run_thread(arg1, arg2, etc); // The current
| thread does not leave // this block until all threads
| finish. }
|
| I'm happy to answer questions.
|
| [0]: https://gavinhoward.com/2019/12/structured-concurrency-
| defin...
|
| [1]:
| https://git.yzena.com/Yzena/Yc/src/commit/30f4ae4e471cb5a500...
| speps wrote:
| (2016)
___________________________________________________________________
(page generated 2022-03-19 23:00 UTC)