Skip to content

Commit

Permalink
Add documentation on ucxx::WorkerProgressThread synchronization
Browse files Browse the repository at this point in the history
  • Loading branch information
pentschev committed Aug 3, 2023
1 parent 6e897fa commit 8cecf5a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cpp/include/ucxx/worker_progress_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ class WorkerProgressThread {
* made private to ensure all UCXX objects are shared pointers for correct
* lifetime management.
*
* This thread runs asynchronously with the main application thread. If you require
* cross-thread synchronization (for example when tearing down the thread or canceling
* requests), use the generic pre and post callbacks with a `CallbackNotifier` that
* synchronizes with the application thread. Since the worker progress itself may change
* state, it is usually the case that synchronization is needed in both pre and post
* callbacks.
*
* @code{.cpp}
* // context is `std::shared_ptr<ucxx::Context>`
* auto worker = context->createWorker(false);
Expand Down

0 comments on commit 8cecf5a

Please sign in to comment.