Re: Concurrency message passing

2021-08-17 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/17/21 2:36 PM, JG wrote: Thanks for the suggestions and explanations. I am not sure what to do in my case though. The situation is as follows. I have a struct that is populated via user input not necessarily at single instance (so that seems to rule out immutable). On the other hand while

Re: Concurrency message passing

2021-08-17 Thread Ali Çehreli via Digitalmars-d-learn
On 8/17/21 11:36 AM, JG wrote: >>> Maybe message parsing isn't the >>> correct solution? I use message passing in many of my programs. > After being populated it should be passed to > the other thread and no references are kept. Then you simply cast to-and-from 'shared' and be happy with it.

Re: Concurrency message passing

2021-08-17 Thread JG via Digitalmars-d-learn
On Tuesday, 17 August 2021 at 12:24:14 UTC, Steven Schveighoffer wrote: On 8/17/21 7:05 AM, JG wrote: Hi I have a program with two threads. One thread produces data that is put in a queue and then consumed by the other thread. I initially built a custom queue to do this, but thought this

Re: Concurrency message passing

2021-08-17 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/17/21 7:05 AM, JG wrote: Hi I have a program with two threads. One thread produces data that is put in a queue and then consumed by the other thread. I initially built a custom queue to do this, but thought this should have some standard solution in D? I looked at std.concurrency and

Re: Concurrency message passing

2021-08-17 Thread jfondren via Digitalmars-d-learn
On Tuesday, 17 August 2021 at 11:05:09 UTC, JG wrote: Hi I have a program with two threads. One thread produces data that is put in a queue and then consumed by the other thread. I initially built a custom queue to do this, but thought this should have some standard solution in D? I looked