在 C/C++ 中实现工作窃取队列?

Implementation of a work stealing queue in C/C++?(在 C/C++ 中实现工作窃取队列?)
本文介绍了在 C/C++ 中实现工作窃取队列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找在 C/CPP 中正确实现工作窃取队列的方法.我环顾了谷歌,但没有发现任何有用的东西.

I'm looking for a proper implementation of a work stealing queue in C/CPP. I've looked around Google but haven't found anything useful.

也许有人熟悉一个好的开源实现?(我不喜欢实现取自原始学术论文的伪代码).

Perhaps someone is familiar with a good open-source implementation? (I prefer not to implement the pseudo-code taken from the original academic papers).

推荐答案

没有免费的午餐.

请看盗纸原作.这篇论文很难理解.我知道那篇论文包含理论证明而不是伪代码.但是,根本没有比 TBB 更简单的版本更多.如果有的话,它不会提供最佳性能.工作窃取本身会产生一些开销,因此优化和技巧非常重要.特别是,出队必须是线程安全的.实现高度可扩展和低开销的同步具有挑战性.

Please take a look the original work stealing paper. This paper is hard to understand. I know that paper contains theoretical proof rather than pseudo code. However, there is simply no such much more simple version than TBB. If any, it won't give optimal performance. Work stealing itself incurs some amount of overhead, so optimizations and tricks are quite important. Especially, dequeues are must be thread-safe. Implementing highly scalable and low-overhead synchronizations are challenging.

我真的很想知道你为什么需要它.我认为正确的实现意味着类似于 TBB 和 Cilk.同样,工作窃取很难实施.

I'm really wondering why you need it. I think that proper implementation means something like TBB and Cilk. Again, work stealing is hard to implement.

这篇关于在 C/C++ 中实现工作窃取队列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Rising edge interrupt triggering multiple times on STM32 Nucleo(在STM32 Nucleo上多次触发上升沿中断)
How to use va_list correctly in a sequence of wrapper functions calls?(如何在一系列包装函数调用中正确使用 va_list?)
OpenGL Perspective Projection Clipping Polygon with Vertex Outside Frustum = Wrong texture mapping?(OpenGL透视投影裁剪多边形,顶点在视锥外=错误的纹理映射?)
How does one properly deserialize a byte array back into an object in C++?(如何正确地将字节数组反序列化回 C++ 中的对象?)
What free tiniest flash file system could you advice for embedded system?(您可以为嵌入式系统推荐什么免费的最小闪存文件系统?)
Volatile member variables vs. volatile object?(易失性成员变量与易失性对象?)