diff --git a/akka-actor/src/main/scala/akka/dispatch/PinnedDispatcher.scala b/akka-actor/src/main/scala/akka/dispatch/PinnedDispatcher.scala index eb5b2686c3..9cdff4b521 100644 --- a/akka-actor/src/main/scala/akka/dispatch/PinnedDispatcher.scala +++ b/akka-actor/src/main/scala/akka/dispatch/PinnedDispatcher.scala @@ -26,7 +26,7 @@ class PinnedDispatcher( Int.MaxValue, Duration.Zero, _mailboxType, - _threadPoolConfig.copy(allowCorePoolTimeout = true, corePoolSize = 1, maxPoolSize = 1), + _threadPoolConfig.copy(corePoolSize = 1, maxPoolSize = 1), _shutdownTimeout) { @volatile diff --git a/akka-docs/rst/java/dispatchers.rst b/akka-docs/rst/java/dispatchers.rst index b25a1c33b0..0be567ea7f 100644 --- a/akka-docs/rst/java/dispatchers.rst +++ b/akka-docs/rst/java/dispatchers.rst @@ -123,6 +123,15 @@ And then using it: .. includecode:: ../java/code/docs/dispatcher/DispatcherDocTestBase.java#defining-pinned-dispatcher +Note that ``thread-pool-executor`` configuration as per the above ``my-thread-pool-dispatcher`` example is +NOT applicable. This is because every actor will have its own thread pool when using ``PinnedDispatcher``, +and that pool will have only one thread. + +Note that it's not guaranteed that the *same* thread is used over time, since the core pool timeout +is used for ``PinnedDispatcher`` to keep resource usage down in case of idle actors. To use the same +thread all the time you need to add ``thread-pool-executor.allow-core-timeout=off`` to the +configuration of the ``PinnedDispatcher``. + Mailboxes --------- diff --git a/akka-docs/rst/scala/dispatchers.rst b/akka-docs/rst/scala/dispatchers.rst index 68182af86e..3ca629b54c 100644 --- a/akka-docs/rst/scala/dispatchers.rst +++ b/akka-docs/rst/scala/dispatchers.rst @@ -129,6 +129,11 @@ Note that ``thread-pool-executor`` configuration as per the above ``my-thread-po NOT applicable. This is because every actor will have its own thread pool when using ``PinnedDispatcher``, and that pool will have only one thread. +Note that it's not guaranteed that the *same* thread is used over time, since the core pool timeout +is used for ``PinnedDispatcher`` to keep resource usage down in case of idle actors. To use the same +thread all the time you need to add ``thread-pool-executor.allow-core-timeout=off`` to the +configuration of the ``PinnedDispatcher``. + Mailboxes ---------