[dmd-concurrency] draft 5

Robert Jacques sandford at jhu.edu
Tue Jan 19 08:48:59 PST 2010


On Tue, 19 Jan 2010 08:02:25 -0500, Michel Fortin  
<michel.fortin at michelf.com> wrote:
> Last is an idea to improve the API, but probably won't have any  
> consequence on the book unless you want to talk about it. In addition to  
> the function taking standard enumerated values I think having this would  
> be great:
>
> 	alias void delegate(Variant message) shared OnCrowdingHandler;
> 	void setMaxMailboxSize(Tid tid, size_t messages, OnCrowdingHandler  
> doThis);
>
> With this I could setup things so that if one thread is crowded the  
> message would be sent to another thread instead. I could also want to  
> write a log of those unpassed messages or something. Or I could make a  
> zero-sized mailbox and use the crowding callback to send the message  
> using an alternate dispatching mechanism (like sending a GUI event,  
> making the GUI tread able to receive messages).
>

Currently, alias void delegate(Variant message) shared OnCrowdingHandler;  
doesn't compile, though I definitely see the usefulness of shared  
delegates. Should this be filed in bugzilla?


More information about the dmd-concurrency mailing list