ptupitsyn commented on a change in pull request #9049:
URL: https://github.com/apache/ignite/pull/9049#discussion_r621536752
##########
File path: docs/_docs/key-value-api/basic-cache-operations.adoc
##########
@@ -245,18 +249,29 @@
include::code-snippets/cpp/src/cache_asynchronous_execution.cpp[tag=cache-asynch
[NOTE]
====
[discrete]
-=== Closures Execution and Thread Pools
+=== Callbacks Execution and Thread Pools
////////////////////////////////////////////////////////////////////////////////
This is java specific
////////////////////////////////////////////////////////////////////////////////
-If an asynchronous operation is completed by the time the closure is passed to
either the `IgniteFuture.listen()` or `IgniteFuture.chain()` method, then the
closure is executed synchronously by the calling thread. Otherwise, the closure
is executed asynchronously when the operation is completed.
+If an asynchronous operation is completed by the time the callback is passed
to either the `IgniteFuture.listen()` or `IgniteFuture.chain()` method, then
the callback is executed synchronously by the calling thread.
+Otherwise, the callback is executed asynchronously when the operation is
completed.
+
+Callbacks for asynchronous compute operations are called by threads from the
/perf-and-troubleshooting/thread-pools-tuning[Ignite public pool].
+Therefore, you should avoid calling synchronous cache and compute operations
from inside the callback, because it may lead to a deadlock due to pools
starvation.
+To achieve nested execution of asynchronous compute operations, you can take
advantage of
/perf-and-troubleshooting/thread-pools-tuning#creating-custom-thread-pool[custom
thread pools].
+
+Callbacks for asynchronous cache operations are called using
`IgniteConfiguration#asyncContinuationExecutor`, which defaults to
`ForkJoinPool#commonPool`.
+
+* This default executor is safe for any operations inside the callback.
+* Default behavior has changed in Ignite 2.11. Before that, async cache
operation callbacks were called from an Ignite system pool (so-called "striped
pool").
+* To restore the previous behavior, use
`IgniteConfiguration.setAsyncContinuationExecutor(Runnable::run)`.
+** Can provide a small performance improvement in some situations, because
callbacks are executed without any indirection or scheduling.
Review comment:
Fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]