I have a high CPU/memory bound task that I would like my Scala program to execute in parallel. So, I'm using the Actors framework (using receive in a while(true) loop). I call the start method on the actor and send it thousands of messages to process.
During the execution of the program (takes about an hour), only 100 - 120% of the CPU is used. The machine has 8 cores. Shouldn't the actor spawn multiple threads to use up all the 8 cores, and I should see usage close to 800%?
Or am I supposed to instantiate 8 actors and send it each some of the messages (or rather get them all to read from some concurrent queue)?
Thanks.