并发可变优先级队列 [英] Concurrent mutable priority queue

查看:180
本文介绍了并发可变优先级队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有并发可变优先级队列?理想情况下,我正在寻找一个C ++实现,但是,对于初学者来说,指向算法的指针将是非常有用的。

Is there a concurrent mutable priority queue? Ideally, I'm looking for a C++ implementation, but, for starters, a pointer to an algorithm would be very helpful.

要清楚,我正在寻找一个优先级队列,我可以调整元素的优先级。特别地,TBB的 concurrent_priority_queue 不提供必要的功能。 (就此而言,STL的 priority_queue 也不会,即使我们忽略并发性。) Boost.Heap 库提供了我想要的串行功能,但没有并发。自然,我正在寻找比每个操作更精细的东西,而不仅仅是锁定整个队列。

To be clear, I'm looking for a priority queue where I can adjust the priorities of the elements. In particular, TBB's concurrent_priority_queue doesn't provide the necessary functionality. (For that matter, neither does STL's priority_queue, even if we ignore the concurrency.) Boost.Heap library provides serial functionality that I want, but without concurrency. Naturally, I'm looking for something finer grained than just locking the entire queue on every operation.

推荐答案

并发优先级队列是通常使用滑雪板实施,所以Facebook的 ConcurrentSkipList 可能符合您的要求。

A concurrent priority queue is often implemented using a skiplist, so Facebook's ConcurrentSkipList may fit your requirements.

这篇关于并发可变优先级队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆