On 3/21/23 22:30, Tim wrote:
> to make a simple multi-threading application.

Unless there is a reason not to, I recommend std.concurrency and std.parallelism modules. They are different but much more simpler compared to the low-level core.thread.

> args_copy = args; //Why program name is missing while copy arguments?

That doesn't copy. Both args_copy and args will be references to the same elements. (They are both array slices.)

The following may work to get a shared argument:

    immutable args_copy = args.idup;

idup makes an immutable copy and immutable is implicitly shared.

Even if that works, I still find std.concurrency much easier to deal with. :)

Ali

  • Threads Tim via Digitalmars-d-learn
    • Re: Threads Kagamin via Digitalmars-d-learn
    • Re: Threads Ali Çehreli via Digitalmars-d-learn

Reply via email to