I have a program that is highly multi-threaded and it contains an intrusive linked list of objects. I need to pass off the objects in this list to several threads, but only 1 thread will ever own the object at a time, meaning that I don't need this object or the pointer to it be shared.
I wanted to create an intrusive list with a unique_ptr using boost, but from what I've read the unique_ptr would not be compatible with the Boost intrusive library as it does not have the right ownership semantics.
Per this the intrusive library requires it's elements (pointers) to have the same ownership semantics as a raw pointer. So unique_ptr or even shared_ptr would not qualify.
I wondered if anyone could give me some advice on how to best implement my intrusive list then so I can safely pass its elements through several threads and know that they are being MOVED to that thread and NOT shared amongst threads?