I need the above data structure for an application I’m writing. I wondered if there is a library that already implements it or if I have to write it myself?
I don’t really want to reinvent the wheel if it is not necessary.
I need this structure to be able to add and remove items using multiple threads without having to lock up the whole structure while doing so.
Link to a related research: Is a lock (wait) free doubly linked list possible?
As you are not requesting a lock-free container, I am not marking this as an exact duplicate.
Note: while the interface and performance characteristics looks like a double linked list, internally those structures are very complex, based on hash tables or other structures. There is nothing which would a a double linked list internally and would be lock free at the same time. I do not remember seeing a proof, but I think this is not possible.
Based on your additional information, I think you do not need a double linked list at all. You can use the Windows API single linked list instead. To add use InterlockedPushEntrySList, to remove for processing use InterlockedPopEntrySList.