Safe std.parallelism

Simen kjaeraas simen.kjaras at gmail.com
Wed Sep 15 08:30:26 PDT 2010


dsimcha <dsimcha at yahoo.com> wrote:


> 2.  Just overload task(), map() and reduce() so that the overload marked
> @trusted can be used in SafeD and is as safe as std.concurrency, and the
> unsafe version can be called from @system code.

This seems to me the best solution.


> 1.  Create safeTask(), safeMap(), safeReduce() that only accept safe
> arguments.  This is ugly but explicit.  Suggestions for better names  
> would be
> appreciated.

> 3.  Name the safe versions task(), map() and reduce() and rename the  
> unsafe
> versions something else.  (I kind of don't like this because  
> std.parallelism,
> by its nature, is mostly geared towards unsafe, pedal-to-metal  
> parallelism.)

Of these, #1 breaks with the D tradition (or stated such, anyway) of
safe being the default.

-- 
Simen


More information about the Digitalmars-d mailing list