getOpt with shared

Danny Arends Danny.Arends at gmail.com
Fri May 11 18:01:18 UTC 2018


On Friday, 11 May 2018 at 17:49:17 UTC, Jonathan M Davis wrote:
> On Friday, May 11, 2018 17:25:44 Danny Arends via 
> Digitalmars-d-learn wrote:
>> [...]
>
> getopt is designed to be single-threaded. The keyword shared is 
> not used a single type in that module. If you want to use 
> shared with anything in D, you have three options:
>
> [...]

Hey Jonathan,

Thanks for the long and insightful answer.
The object is indeed constructed from the main thread, but 
afterwards multiple threads need to read the values given via the 
command line. since everything in the object is read only I was 
hoping to get away with making it shared.

I should just define tls variables to use with getopt and then 
set the corresponding variables in the shared object.

Danny


More information about the Digitalmars-d-learn mailing list