[dmd-concurrency] std.concurrency

Sean Kelly sean at invisibleduck.org
Tue Mar 9 10:39:19 PST 2010


On Mar 9, 2010, at 9:50 AM, Igor Lesik wrote:

>> By the way, I've been thinking about receive((int x) {}, (Variant x) {}) and I wonder if rather than testing the first element in the queue and having the Variant delegate getting the value if it's not an int, that the correct behavior should perhaps be to search the entire queue for an int and if there aren't any then take the first element and give it to the Variant.
> 
> Consider receive((int x){},(string s){}), first element in the queue is string, do you search for int in the whole queue in this case? No, you search for a handler for string. Case receive((int x) {}, (Variant x) {}) is not (and should not be) different. With what you propose user will experience very non deterministic behavior with messages processed completely out of order; consider long queue [var, string, ..., int] with int at end, why on earth user wants last element in the queue to be handled first?
> 
> Plus it will mess up msg priorities, in case we implement them one day.

Yeah, it was just and idle thought.


More information about the dmd-concurrency mailing list