How to share an appender!string?

Rene Zwanenburg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu May 19 03:58:42 PDT 2016


On Thursday, 19 May 2016 at 10:41:14 UTC, Thorsten Sommer wrote:
> On Thursday, 19 May 2016 at 10:13:21 UTC, rikki cattermole 
> wrote:
>
>> At this point I'd recommend you to just ignore Appender.
>> Write your own.
>
> Dear rikki,
>
> Thanks for the proposal :) Here is the new attempt #4 as simple 
> test case: https://dpaste.dzfl.pl/f6a9663320e5
>
> It compiles & runs, but the array of strings gets not shared 
> across threads :( I am sure that I missed something about the 
> shared() concept...
>
> Hmm...
>
>
> Best regards,
> Thorsten

Calling task() only creates a Task, you also have to start it 
somehow. The documentation contains an example:

https://dlang.org/phobos/std_parallelism.html#.task


More information about the Digitalmars-d-learn mailing list