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.
- Scala actors, futures and system calls resulting in Thread leaks
- Scala and Akka - Testing actors as a system with Akka Testkit
- Clarification needed about futures and promises in Scala
- scala actors vs threads and blocking IO
- Scala Futures and java 8 CompletableFuture
- Scala - futures and concurrency
- Parallel collections in Scala 2.9 and Actors
- Scala and Java Real-Time System
- What's the difference between Erlang Actors, Scala Actors and the theoretical concept "Actor"?
- Futures for blocking calls in Scala
- Scala and Java futures apparently having unexpected interactions
- Scala futures and `andThen` exception propagation
- Combining Scala Futures and collections in for comprehensions
- Scala objects and thread safety
- Scala futures and threads
- Asynchronous http requests using Netty and Scala actors
- Play Scala and thread safety
- Deadlock with synchronized and scala futures
- Combining Futures (Twitter) and Either in Scala
- Scala Actors instead of Java Futures
- Do Scala futures support for non-blocking combinators such as firstNCompletedOf and firstNSuccCompletedOf?
- Scala futures: what is the main thread expected to do while futures are executing?
- Stackoverflow Exception using Scala actors and receiveWithin
- Thread monitoring for scala actors
- scala actors and persistence context
- Is scala sufficient for native, system and kernel programming?
- Scala actors thread control
- How to reaload scala application after code change using actors and sbt
- Play 2.1 Scala chain multiple futures and promises
- How do Scala Futures operate on threads? And how can they be used to execute async & non-blocking code?
More Query from same tag
- Spark 2.0 How to convert DF Date/timstamp column to another date format in scala?
- Is it possible to access estimator attributes in spark.ml pipelines?
- Scala convert WrappedArray or Array[Any] to Array[String]
- sbt-assembly : including test classes
- How to decode List of 0s and 1s by List of positions of 1?
- Show which class/traits/object are incorrect in IntelliJ's Project window
- Deserialize JSON distinguising missing and null values
- A library in Scala -- use in Android
- Scala abstract classes
- Scala Case Classes vs. Protocol Buffers with Akka over the network
- How to convert a maptype into SparkML sparse vector in Spark?
- scala: sum of squares of every even-positioned digits starting from 2nd position
- Why cant we use Any or Nothing in scala pattern matching?
- Left Anti join in Spark dataframes
- scala - Spark : How to union all dataframe in loop
- ensimeConfig creates directories java and scala-2.11, which I don't need
- In a scala project with multiple modules, where to define values accessible globally in all the build.sbt's within the same project
- Scala api and java compatibility, do you have to remap?
- What is time complexity of `last` method for List in scala?
- Extracting regions from a Scala Array
- sbt multi-module project: inter-dependency of integration tests
- Add Tuple Object into List Scala
- pattern match on a list to check empty
- How to extract data type of the generics type parameter?
- Immutability and memory usage
- Why does partition parameter of SparkContext.textFile not take effect?
- Get common element from 2 given lists
- Scala Implicit Type Conversion of Classes with Type Parameters
- Reflection on a Scala case class
- How to set default value to 'null' in Dataset parsed from RDD[String] applying Case Class as schema