[dmd-concurrency] priority messages

Michel Fortin michel.fortin at michelf.com
Mon Jan 25 10:02:08 PST 2010


Le 2010-01-25 à 12:55, Steve Schveighoffer a écrit :

>> I'd say those should be just "tasks". Sending one would execute that task in the 
>> given thread, inside receive. Tasks could be shared delegates, functions, or 
>> structs and objects defining opCall.
> 
> How does that scale to inter-process communication?  One thing that was nice about the message passing is it was seamless as far as inter-process since the messages could be serialized to be sent via IPC.  Executing arbitrary code can only be feasible within the same process.

Obviously, delegates and function pointers won't work with inter-process communication. But if you can serialize and unserialize an object with an opCall member, then it'll work. The object could contain a script, or execute some predefined code.

There's already some precedents: sending a reference to a shared object should work across threads. But across processes that's more dubious. Sending a Tid to another thread in the same process makes sense, but not to another process.

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/





More information about the dmd-concurrency mailing list