Reddit let me to this article walking through an example of Goroutines[1]. I 
figured it could look about the same in D. So I set out to learn some 
multi-threading. And what I ended up with[2] had an issue.

The mailbox size seems to be extremely small. Currently I have set the size to 
10,000 and put a OnCrowding.throwException, though I wanted it to block, 
changing it will result in a program that won't exit, and it will not have 
finished processing all the calls. The last option of ignoring will result in 
many calls not being finished.

This is tested no Linux, but I will test it on Windows tomorrow. I am running 
it with:

./callcenter 3 10 10 10

which says, 3 agents, 10 calls, with a maximum of 10 secs to process a call, 
and 10 ticks before creating the next call.

1. 
http://www.mprescient.com/journal/2011/1/9/concurrency-in-go-a-call-center-tutorial.html
2. https://gist.github.com/773979

Reply via email to