Improving throughput for WorkStealer even more

This commit is contained in:
Viktor Klang 2011-04-29 16:14:29 +02:00
parent d89c286fb2
commit b5873ff2c7

View file

@ -80,7 +80,7 @@ class ExecutorBasedEventDrivenWorkStealingDispatcher(
override private[akka] def dispatch(invocation: MessageInvocation) = {
val mbox = getMailbox(invocation.receiver)
if (donationInProgress.value == false && mbox.dispatcherLock.locked && attemptDonationOf(invocation, mbox)) {
if (donationInProgress.value == false && (!mbox.isEmpty || mbox.dispatcherLock.locked) && attemptDonationOf(invocation, mbox)) {
//We were busy and we got to donate the message to some other lucky guy, we're done here
} else {
mbox enqueue invocation