Skip to content

Latest commit

 

History

History
17 lines (15 loc) · 804 Bytes

cpp-asio.rst

File metadata and controls

17 lines (15 loc) · 804 Bytes

Asynchronous I/O

The C++ API uses Boost.Asio for asynchronous operations. There is a :cppspead2::thread_pool class (essentially the same as the Python :pyspead2.ThreadPool class). However, it is not required to use this, and you may for example run everything in one thread to avoid multi-threading issues.

spead2::thread_pool

A number of the APIs use callbacks. These follow the usual Boost.Asio guarantee that they will always be called from threads running :cppboost::asio::io_service::run. If using a :cpp~spead2::thread_pool, this will be one of the threads managed by the pool. Additionally, callbacks for a specific stream are serialised, but there may be concurrent callbacks associated with different streams.