Original Post
I've implemented a lockless ring queue, and it works quite well. However, I need a tiny bit more functionality from it, but I can't seem to get around using a mutex of some kind, which really kills my multithreading. Ideally, I'd like to implement a list of objects that is sorted by an associated integer (an timestamp of sorts). Once created, no additional objects are added to the queue. A thread picks the first object off the queue (the one with the lowest timestamp) and updates the timestamp. Now the thread need to re-insert this object into the queue, its location within dependent on the timestamp's value. I can't think of a way to do this in a lockless fashion. I've implemented a std::list with locks around the "pop" and "push_back/sort" functions, but that really bottlenecks performance. Any ideas?