DConf '22 Talk: Structured Concurrency

Markk markus.kuehni at triviso.ch
Wed Oct 12 09:28:07 UTC 2022


Hi,

having watched the [Structured Concurrency 
talk](https://youtu.be/hJhNhIeq29U), and very likely missing 
something, I wondered if **@Sebastiaan Koppe**, or anybody else, 
has ever compared this to [OpenMP](https://www.openmp.org/). If 
I'm not mistaken (and after just having [watched the very nice 
Intel 
tutorial](https://www.youtube.com/playlist?list=PLLX-Q6B8xqZ8n8bwjGdzBJ25X2utwnoEG) to refresh my limited knowledge), OpenMP seems to use the same kind of scoping/structuring, and allowing composition.

So, again unless I'm missing something, I guess the term 
"Structured Concurrency" and "Composability" would equally apply 
to the much older (1997) OpenMP solution, right? If true, it was 
_not_ missed for 30 years, [as Walter Bright wondered, during 
Q&A](https://www.youtube.com/watch?v=hJhNhIeq29U&t=3134s) 😉

Note:  Most OpenMP examples just obsess about `for` loops and 
plain parallelism, but make no mistake, there is much more to it. 
One must also understand the `section` and `task` directives, to 
grasp the full capabilities.

IMHO this is all extremely elegant:
- [Parallelize a program without breaking the serial 
version](https://youtu.be/EaX8efKce9M?t=408).
- Going from [this problem](https://youtu.be/I0c9-W0MBqw?t=99) 
(and after a very inelegant manual detour), you get [this 
solution using `task`](https://youtu.be/mNPmylnhYYQ?t=66) 
(amazing!).

It seems to me that such a language integrated and mostly 
_declarative_ solution, would be very "D"-ish. _Declarative_ IMHO 
is the "right" way to go with the increasing NUMA characteristics 
of systems (also think the problematic of E- and P-cores). One 
must let the compiler/runtime decide the best 
threading/scheduling strategy on a given platform, otherwise the 
code will likely age badly, quickly.

I really wonder if this is one of these famous cases where the 
same old concept is "reinvented" using different buzzwords? Just 
because a tech is old does not mean it is bad, I would say _au 
contraire!_ I sometimes wonder: are the supercomputing grandpas 
just too unfashionable for the cloud/web-kiddies to talk with?

-Mark


More information about the Digitalmars-d mailing list