无锁队列“多个生产者 - 单个消费者”存在于Delphi? [英] Does a lock-free queue "multiple producers-single consumer" exist for Delphi?

查看:881
本文介绍了无锁队列“多个生产者 - 单个消费者”存在于Delphi?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为单个生产者单个消费者找到了几个实现,但是对于多个生产者单个消费者来说,没有一个。

I've found several implementations for single producer-single consumer, but none for multiple producer-single consumer.

多个生产者单一消费者存在于Delphi?

Does a lock-free queue for "multiple producers-single consumer" exist for Delphi?

推荐答案

OmniThreadLibrary 支持多个生产者。您可以从线程库中单独使用它(即可以在任何其他框架中使用OtlContainers单元)。

Lock-free queue from the OmniThreadLibrary supports multiple producers. You can use it separately from the threading library (i.e. you can use OtlContainers unit in any other framework).

正如Daniele在下面所指出的那样,OmniThreadLibrary中有两个队列。 OtlContainers中的一个支持多个生产者和多个消费者,而OtlComm中的更智能版本(仅仅是简单版本的包装器)只是单个生产者/单个消费者。

As the Daniele pointed below, there are two queues in the OmniThreadLibrary. The one in the OtlContainers supports multiple producers and multiple consumers while the "smarter" version in OtlComm (which is just a wrapper for the simpler version) is only single producer/single consumer.

文档仍然是OmniThreadLibrary项目的一个大问题:(有关队列中的一些信息可以找到这里

Documentation is still a big problem of the OmniThreadLibrary project :(. Some information on the queue can be found here .

这篇关于无锁队列“多个生产者 - 单个消费者”存在于Delphi?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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