ACE vs增强线程 [英] ACE vs boost threading

查看:82
本文介绍了ACE vs增强线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我们开始研究多线程应用程序,它将提供高TPS(每秒事务数)的消息。我们需要编写独立于平台的代码,这些代码可以在Windows和Linux上运行。因此,我们计划使用库进行多线程编程。我通过互联网搜索,大多数人建议两个图书馆ACE和提升。 我们没有使用套接字。 我应该选择哪个库。我们还需要多核支持。



如果您有任何更好的建议,请告诉我们。



提前致谢。

Hi,

We started working on Multithreaded application which will serve high TPS (transaction per second) messages. We need to write platform independent code which will work on Windows as well as on Linux. So, we are planning to use library for multithreaded programming. I searched through internet and mostly people suggests two libraries ACE and boost. We are not using sockets. Which library I should prefer. We also need to have multicore support.

Please let us know if you have any better suggestions.

Thanks in advance.

推荐答案

Boost,ACE和Qt都为Windows和Linux提供POSIX线程包装器。 ACE并没有专注于此,它专注于通信,而且它在设计方面也有所老化,所以我不会选择ACE。

Boost和QT都提供了比多线程支持更多的功能,在这两种情况下,您都必须根据依赖性来获取包。如果你对Qt UI不感兴趣,那么Qt可能是一种浪费,它的多线程支持有点不同寻常。有些人已经习惯了未来的想法。

Boost不会给你带来与UI的关系,提供合理的直接线程,是相当的迄今为止在设计方面,将继续得到支持和发展。它也适用于你可能需要的任何平台,因此Boost看起来最好。

然而,在不利的一面,Boost代码可能会令人难以阅读和理解。 Boost更新频率相当高,这对某些人来说可能是一个问题。

从理论的角度来看,你应该做的是转向C ++ 11标准线程,尽管我不是知道Boost是否接近,但随着时间的推移,它肯定会越来越近。如果项目是长期的,你可能会考虑使用Clang和libC ++,它有C ++ 11线程在Linux和OSX AFAIK上运行但在Windows上还不行。

标准库(libC ++或同等版本)比Boost更低级,更简单,最终,希望是一个可移植的接口。
Boost, ACE and Qt all offer POSIX thread wrappers for Windows and Linux. ACE is not focused on this though, it''s focused on comms and it''s also aging somewhat in design terms so I wouldn''t go with ACE.
Both Boost and QT offer a lot more than multithreading support and in both cases you have to take the package in terms of dependencies. If you''re not interested in the Qt UI then Qt would probably be a waste and its multi threading support is a little unconventional. Some people have a bit of a struggle getting used to the idea of ''futures''.
Boost won''t burden you with ties to a UI, offers reasonably straight forward threading, is quite up to date in terms of design and will continue to be supported and developed. It''s also going to work on whatever platform you''re likely to need so Boost looks best.
However on the down side Boost code can be mind bendingly hard to read and understand. Boost updates are pretty high frequency aswell which could be an issue for some.
From a theoretical point of view what you should be doing is moving toward C++11 standard threading and although I don''t know if Boost is close to that yet it will surely be getting closer as time goes on. If the project is long term you might look at using Clang and libC++ which has C++11 threading working on Linux and OSX AFAIK but not quite on Windows yet.
The standard library (libC++ or equivalent) is lower level than Boost, much simpler and will eventually, hopefully be a portable interface.


解决方案2很棒...但为什么不使用C ++中的新线程11?它将在您可以想到的每个平台上进行标准化和支持,并且大多数新编译器已经支持它(新的gcc和vc编译器已经支持它)。通常使用本地语言的一部分而不是库中的某些东西要好得多,特别是如果这是你使用库的唯一原因(如果你使用多个组件我说得去吧。



据说...升级可能是最成熟/最精致的线程库,所以如果你选择使用一个现有的库,我会去那,但就像我说的,如果你可以使用C ++ 11,为什么不使用现在是该语言一部分的线程?
Solution 2 is great... but why not just use the new threading that is in C++11? It will be standardized and supported across every platform that you can think of and most new compilers already support it (new gcc and vc compilers already support it). Usually it''s a lot better to use something that''s part of the native language than something that is part of a library, specially if that''s the only reason you are using the library (if you were using multiple components I''d say go for it).

With that said... boost is probably the most mature/refined threading library out there, so if you opt for using an existing library, I''d go for that but like I said, if you can use C++11, why not use the threading that''s now part of the language?


一个非常好的可读的图书馆 [ ^ ] :) br />


Qt是一个完整的开发框架

,其工具旨在简化应用程序和用户界面的创建/>
用于桌面,嵌入式和移动平台。
A very good readable library[^] :)

"Qt is a full development framework
with tools designed to streamline the creation of applications and user interfaces
for desktop, embedded and mobile platforms."


这篇关于ACE vs增强线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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