You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the MRC library, we are using Boost Fibers to allow for async processing. Our library currently has it's own C++ wrapper to UCX that works well with Boost Fibers since we can yield the thread during any network I/O stalls.
We would love to switch to using UCXX to replace our current C++ wrapper around UCX but we would need the ability to use boost threading primitives instead of the standard library ones.
If you havent worked with Boost Fibers before, there are a couple of things to be aware of:
Instead of using any of the standard library threading primitives, use the equivalent in boost::fibers namespace
i.e. Instead of std::mutex, use boost::fibers::mutex. And instead of std::thread, use boost::fibers::fiber
The interface is nearly identical between the two namespaces. We just use a typedef in MRC to make this easier
This is really only needed for the public facing API. Internally, if you create any threads, you wouldnt want to change that.
Avoid using thread local storage
Thread local storage doesnt work in Boost Fibers because multiple fibers will all see the same thread local value. Instead they have fiber local storage, boost::fibers::fiber_specific_ptr
In the MRC library, we are using Boost Fibers to allow for async processing. Our library currently has it's own C++ wrapper to UCX that works well with Boost Fibers since we can yield the thread during any network I/O stalls.
We would love to switch to using UCXX to replace our current C++ wrapper around UCX but we would need the ability to use boost threading primitives instead of the standard library ones.
If you havent worked with Boost Fibers before, there are a couple of things to be aware of:
boost::fibers
namespacestd::mutex
, useboost::fibers::mutex
. And instead ofstd::thread
, useboost::fibers::fiber
typedef
in MRC to make this easierboost::fibers::fiber_specific_ptr
The text was updated successfully, but these errors were encountered: