Revamped concurrency API

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Oct 12 22:45:41 PDT 2009


MIURA Masahiro wrote:
> Sean Kelly wrote:
>> void sendmsg(T)( Pid pid, T val );
>> final void recvmsg(T...)( Pid pid, T ops );
>> Pid spawn(T)( T fun );
>>
>> spawn() is pretty limited so far in that it only spawns threads--I'd
>> expect that function to end up with multiple overloads at some point.
> 
> Interesting.  Future spawn() may spawn the thread in a remote CPU that
> doesn't share the memory.  In that case it perhaps helps to limit fun to
> be pure, and val to be immutable, as in Erlang.  D already has pure and
> transitive const, so the first few steps for the massively-parallel
> D programs are already completed! :-)

That's the plan, except that we weren't thinking of creating remote
processes, only sending messages across process and machine boundaries.
Here's where notions like value vs. reference and deep cloning become
very important.


Andrei



More information about the Digitalmars-d mailing list