How to create Multi Producer-Single Consumer concurrency

Bagomot bagomot at gmail.com
Wed Jul 13 19:43:47 UTC 2022


On Wednesday, 13 July 2022 at 19:06:48 UTC, Ali Çehreli wrote:
> On 7/13/22 02:25, Bagomot wrote:
>
> > How to do the same with `taskPool` instead of `spawnLinked`?
>
> You are hitting the nail on the head. :) std.parallelism, which 
> taskPool is a concept of, is for cases where operations are 
> independent.
>
> However, producer and consumer are by definition dependent, so 
> it's a problem for std.concurrency, which involves message 
> boxes.
>
> You can do the same with std.parallelism or core.thread but you 
> would be implementing some of what std.concurrency already 
> provides.
>
> The following are my understandings of these topics:
>
>   http://ddili.org/ders/d.en/parallelism.html
>
>   http://ddili.org/ders/d.en/concurrency.html
>
>   http://ddili.org/ders/d.en/concurrency_shared.html
>
> The introduction section of the Concurrency chapter lists some 
> differences.
>
> Ali

Thank you! I understood the difference between `std.parallelism` 
and `std.concurrency`. My question no longer relevant :)


More information about the Digitalmars-d-learn mailing list