The thread pool used by the Scala actors may not work liike you think it should, causing actors to starve.
To see why, lets first define a utility method to measure how long an actor takes to act. We take a timestamp, then create an actor that just prints to the console how many milliseconds passed since the timestamp
import scala.actors.Actor._
def timeActor = {
val start = System.currentTimeMillis
actor {println("Took: " + (System.currentTimeMillis - start))}
}
Testing it: