Passing associative array to another thread

Martin Drašar drasar at ics.muni.cz
Tue Sep 25 09:46:48 PDT 2012


Dne 25.9.2012 18:19, Jacob Carlborg napsal(a):
> BTW, why do you need to use std.currency at all if it's immutable, just
> share it as a global. The whole point of immutable is that it can be
> freely shared among threads without any risks.

It is not some single piece of data.

I have a queue of tasks. Each task is a struct that contains among other 
things a user-supplied delegate and an AA with parameters for that delegate.

These tasks are created somewhere, inserted into the queue and then 
executed in parallel. Once created they are not modified anywhere and 
should exist only in one instance that is passed to that delegate.

It's just that I haven't found a better way to pass parameters that are 
unknown before to a delegate.

Martin



More information about the Digitalmars-d-learn mailing list