From 6f36cc950be34a2fa542ba77cf2d5553fe6479e9 Mon Sep 17 00:00:00 2001 From: Vibul Imtarnasan Date: Wed, 28 Mar 2012 17:54:40 +1200 Subject: [PATCH 1/6] Added more dispatcher info. --- akka-docs/scala/dispatchers.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/akka-docs/scala/dispatchers.rst b/akka-docs/scala/dispatchers.rst index 24643b13e2..aefa7db5c7 100644 --- a/akka-docs/scala/dispatchers.rst +++ b/akka-docs/scala/dispatchers.rst @@ -42,6 +42,9 @@ There are 4 different types of message dispatchers: * Dispatcher + - This is an event-based dispatcher that binds a set of Actors to a thread pool. It is the default dispatcher + used if one is not specified. + - Sharability: Unlimited - Mailboxes: Any, creates one per Actor @@ -55,6 +58,8 @@ There are 4 different types of message dispatchers: * PinnedDispatcher + - This dispatcher dedicates a unique thread for each actor passed in as reference. + - Sharability: None - Mailboxes: Any, creates one per Actor @@ -66,6 +71,10 @@ There are 4 different types of message dispatchers: * BalancingDispatcher + - This is an executor based event driven dispatcher that will try to redistribute work from busy actors to idle actors. + + - It is assumed that all actors using the same instance of this dispatcher can process all messages that have been sent to one of the actors; i.e. the actors belong to a pool of actors, and to the client there is no guarantee about which actor instance actually processes a given message. + - Sharability: Actors of the same type only - Mailboxes: Any, creates one for all Actors @@ -79,6 +88,9 @@ There are 4 different types of message dispatchers: * CallingThreadDispatcher + - This dispatcher runs invocations on the current thread only. This dispatcher does not create any new threads, + but it can be used from different threads concurrently for the same actor. + - Sharability: Unlimited - Mailboxes: Any, creates one per Actor per Thread (on demand) @@ -87,6 +99,7 @@ There are 4 different types of message dispatchers: - Driven by: The calling thread (duh) + More dispatcher configuration examples ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -98,6 +111,10 @@ And then using it: .. includecode:: ../scala/code/akka/docs/dispatcher/DispatcherDocSpec.scala#defining-pinned-dispatcher +Note that ``thread-pool-executor`` configuration as per the above ``my-thread-pool-dispatcher`` exmaple 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. + Mailboxes --------- From ae7835bf58cd674aec4152a8bab203d43e35f2cb Mon Sep 17 00:00:00 2001 From: Vibul Imtarnasan Date: Thu, 29 Mar 2012 16:24:03 +1200 Subject: [PATCH 2/6] Update akka-docs/scala/dispatchers.rst --- akka-docs/scala/dispatchers.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/akka-docs/scala/dispatchers.rst b/akka-docs/scala/dispatchers.rst index aefa7db5c7..f077467956 100644 --- a/akka-docs/scala/dispatchers.rst +++ b/akka-docs/scala/dispatchers.rst @@ -58,7 +58,7 @@ There are 4 different types of message dispatchers: * PinnedDispatcher - - This dispatcher dedicates a unique thread for each actor passed in as reference. + - This dispatcher dedicates a unique thread for each actor using it. - Sharability: None @@ -89,7 +89,7 @@ There are 4 different types of message dispatchers: * CallingThreadDispatcher - This dispatcher runs invocations on the current thread only. This dispatcher does not create any new threads, - but it can be used from different threads concurrently for the same actor. + but it can be used from different threads concurrently for the same actor. See :ref:`testing` - Sharability: Unlimited From 76f075448010ad0dc974958c76a83072b24c73bd Mon Sep 17 00:00:00 2001 From: Vibul Imtarnasan Date: Thu, 29 Mar 2012 16:30:36 +1200 Subject: [PATCH 3/6] Added _TestCallingThreadDispatcherRef --- akka-docs/scala/testing.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/akka-docs/scala/testing.rst b/akka-docs/scala/testing.rst index ea2e632051..15f73f4ef0 100644 --- a/akka-docs/scala/testing.rst +++ b/akka-docs/scala/testing.rst @@ -497,6 +497,8 @@ see any deadline. Currently, the only option is to use ``probe.within`` in the above code to make it work; later versions may include lexically scoped deadlines using implicit arguments. +.. _TestCallingThreadDispatcherRef: + CallingThreadDispatcher ======================= From 2977efef452ad981dfe4770081d16823bbc096b9 Mon Sep 17 00:00:00 2001 From: Vibul Imtarnasan Date: Thu, 29 Mar 2012 16:35:30 +1200 Subject: [PATCH 4/6] Update as per Roland Kuhn's suggestions --- akka-docs/scala/dispatchers.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/akka-docs/scala/dispatchers.rst b/akka-docs/scala/dispatchers.rst index f077467956..388edf9952 100644 --- a/akka-docs/scala/dispatchers.rst +++ b/akka-docs/scala/dispatchers.rst @@ -89,7 +89,8 @@ There are 4 different types of message dispatchers: * CallingThreadDispatcher - This dispatcher runs invocations on the current thread only. This dispatcher does not create any new threads, - but it can be used from different threads concurrently for the same actor. See :ref:`testing` + but it can be used from different threads concurrently for the same actor. See :ref:`TestCallingThreadDispatcherRef` + for details and restrictions. - Sharability: Unlimited From a812f1081fba7bcbeaa5319acdfecb9231a3a5bc Mon Sep 17 00:00:00 2001 From: Vibul Imtarnasan Date: Thu, 29 Mar 2012 16:41:24 +1200 Subject: [PATCH 5/6] Added more dispatcher descriptions --- akka-docs/java/dispatchers.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/akka-docs/java/dispatchers.rst b/akka-docs/java/dispatchers.rst index c28143a60f..6ef0d44d7e 100644 --- a/akka-docs/java/dispatchers.rst +++ b/akka-docs/java/dispatchers.rst @@ -42,6 +42,8 @@ There are 4 different types of message dispatchers: * Dispatcher + - This is an event-based dispatcher that binds a set of Actors to a thread pool. It is the default dispatcher used if one is not specified. + - Sharability: Unlimited - Mailboxes: Any, creates one per Actor @@ -55,6 +57,8 @@ There are 4 different types of message dispatchers: * PinnedDispatcher + - This dispatcher dedicates a unique thread for each actor using it; i.e. each actor will have its own thread pool with only one thread in the pool. + - Sharability: None - Mailboxes: Any, creates one per Actor @@ -66,6 +70,10 @@ There are 4 different types of message dispatchers: * BalancingDispatcher + - This is an executor based event driven dispatcher that will try to redistribute work from busy actors to idle actors. + + - It is assumed that all actors using the same instance of this dispatcher can process all messages that have been sent to one of the actors; i.e. the actors belong to a pool of actors, and to the client there is no guarantee about which actor instance actually processes a given message. + - Sharability: Actors of the same type only - Mailboxes: Any, creates one for all Actors @@ -79,6 +87,10 @@ There are 4 different types of message dispatchers: * CallingThreadDispatcher + - This dispatcher runs invocations on the current thread only. This dispatcher does not create any new threads, + but it can be used from different threads concurrently for the same actor. See :ref:`TestCallingThreadDispatcherRef` + for details and restrictions. + - Sharability: Unlimited - Mailboxes: Any, creates one per Actor per Thread (on demand) From 1b0e0c58e1e26f986459d285b73df58fdd116a9a Mon Sep 17 00:00:00 2001 From: Vibul Imtarnasan Date: Thu, 29 Mar 2012 16:42:05 +1200 Subject: [PATCH 6/6] Update akka-docs/scala/dispatchers.rst --- akka-docs/scala/dispatchers.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/akka-docs/scala/dispatchers.rst b/akka-docs/scala/dispatchers.rst index 388edf9952..7d6a1f6334 100644 --- a/akka-docs/scala/dispatchers.rst +++ b/akka-docs/scala/dispatchers.rst @@ -58,7 +58,7 @@ There are 4 different types of message dispatchers: * PinnedDispatcher - - This dispatcher dedicates a unique thread for each actor using it. + - This dispatcher dedicates a unique thread for each actor using it; i.e. each actor will have its own thread pool with only one thread in the pool. - Sharability: None