score:0

You are using receive so each actor will use its own thread, and you don't at least in this example provide any way for actors to terminate. So you would expect to have one new thread per actor that was ever started. If that is what you see, then all is working as expected. If you want to have actors cease running, you will have to let them eventually fall out of the while loop or call sys.exit on them or somesuch.

(Also, old-style Scala actors are deprecated in favor of Akka actors in 2.11.)

You also don't (in the code above) have any indication whether the future actually completed. If the futures don't finish, they'll keep tying up threads.


Related Query

More Query from same tag