[dmd-concurrency] Sending mesages to non-listening threads
Robert Jacques
sandford at jhu.edu
Wed Jan 13 13:30:54 PST 2010
I've been thinking about this. Obviously, a shared delegate is
perfectly safe. (pure or immutable delegates are also safe) But, there
are some obvious performance/use issues.
I've gone back and analyzed the GPU functions from my research. I've
found that all (save one) could be specified as a map or reduce of a
const delegate. The one exception involved a scatter write which use
used the algorithm's logic + some barriers to prevent races.
Note that D doesn't have shared/immutable/pure/const delegates today.
If you take the address of a member function or a shared member
function you get the same result.
Sent from my iPod
On 2010-01-13, at 4:05 PM, Michel Fortin <michel.fortin at michelf.com>
wrote:
> Le 2010-01-13 à 14:58, Robert Jacques a écrit :
>
>> [...] programming with threads doesn't scale since inevitably you
>> either have too many or not enough.
>>
>> One way to mitigate this is to have a task library like cilk or
>> Intel's Threading Building blocks.
>
> Mac OS X since 10.6 also offers libdispatch where the kernel itself
> can help processes decide when to create new threads. The project is
> opensource and it looks like it might be adopted by FreeBSD too.
>
> <http://libdispatch.macosforge.org/>
>
> The API is very nice to use with blocks (Apple extension to C). Here
> is a multithreaded foreach creating tasks executed by libdispatch:
>
> dispatch_apply(count, queue, ^(size_t i) {
> printf("%u\n",i);
> });
>
> Can we do something like this in D, given all the sharing protections?
>
>
> --
> Michel Fortin
> michel.fortin at michelf.com
> http://michelf.com/
>
>
>
> _______________________________________________
> dmd-concurrency mailing list
> dmd-concurrency at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-concurrency
More information about the dmd-concurrency
mailing list