www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - std.parallism

reply jdrewsen <jdrewsen nospam.com> writes:
Hi,

    Does anyone know how unshared parameters are handled when executing 
a task in std.parallelism.

Most of the examples uses them e.g. when iterating over an unshared 
array (parallelSort example).

I did give the source a quick look but couldn't find a cast to shared 
for parameters anywhere.

Any insights?

Thx.
Jonas
May 03 2011
parent Jason House <jason.james.house gmail.com> writes:
Misuse of std.parallelism can very easily cause accidental sharing of data.
Both in the interfaces to std.parallelism and inside the code, the whole shared
concept is intentionally side stepped. The only use of shared is when using
atomic operations from druntime that were properly coded.

I raised concerns about the module early on, but never had the time to do a
detailed critique. I encourage you to file lots of bugzilla entries on ways to
screw up with std.parallelism.

jdrewsen Wrote:

 Hi,
 
     Does anyone know how unshared parameters are handled when executing 
 a task in std.parallelism.
 
 Most of the examples uses them e.g. when iterating over an unshared 
 array (parallelSort example).
 
 I did give the source a quick look but couldn't find a cast to shared 
 for parameters anywhere.
 
 Any insights?
 
 Thx.
 Jonas
May 05 2011