问题描述
我正在使用 pthreads-win32 来为 Windows 提供线程支持.
I'm using pthreads-win32 to allow threading support for windows.
我有一个使用 pthread 的跨平台项目,我想让它在具有各种编译器和不同操作系统版本的 Windows 上工作.
I have a cross platform project that uses pthreads and I want to make it work on windows with various compilers and different OS versions.
至少,根据文档 pthreads-win32 应该与 MSVC 一起工作,甚至提供 MSVC 版本.
At least, according to the documentation pthreads-win32 should work with MSVC and evenMSVC builds provided.
但我不知道该库是否使用最新的 MSVC 编译器(如 MSVC-2008 和如果在 64 位 Windows 下支持.
But I don't know if the library is tested with latest MSVC compilers like MSVC-2008 andif it is supported under 64bit windows.
根据您自己的经验,您是否知道此库有任何问题?
From Your own experience are you aware of any issues with this library?
- MSVC8、MSVC9、MSVC10 有任何问题吗?
- Windows x86_64 有什么问题吗?
- Windows Vista/Windows 7 有什么问题吗?
注意事项:
- 甚至不要尝试推荐使用 Boost.Thread,我不感兴趣.而且我熟悉 Boost.Thread 库
- 我对用 Win32 API 重新发明轮子(缺少 RW 锁、条件变量等)不感兴趣.
- 我确实设法使用 MSVC-2008 和 MinGW GCC-4.3 编译了一个项目,然后使用当前预编译的 pthreads DLL 轻松地对其运行单元测试.
我只需要知道 pthreads-win32 的限制.
I just need to know limitations of pthreads-win32.
推荐答案
好吧,paxdiablo 显然已经在这里总结了.但是根据我过去使用这个库的经验,我可以在这里添加一些东西.
Well, paxdiablo has apparently summed it up here. But from my past experience with this library, I can add a couple of things here.
首先,我在 MSVC 2008 中使用了库函数的一个子集,没有任何问题.
Firstly, I had used a subset of the library's functions with MSVC 2008 without any problems whatsoever.
其次,我的一些同事已经在 x86_64(使用 MSVC2008 和 MinGW)上实现了它.经过多次 Beta 和 QA 测试周期后,他们也没有遇到任何问题.虽然我自己没有测试过,所以不能很确定这个.
Secondly, some of my colleagues have got it going on the x86_64 (with MSVC2008 and MinGW). They haven't faced any issue either after many a cycles of beta and QA testing. Though I haven't tested it myself so can't be very sure on this one.
所以从外观上看,它可能适合使用.这里唯一需要注意的是,如果您发现任何问题,您将受到不那么活跃的邮件列表的支配(或者您可能想要接触源代码或类似的东西).
So by the looks of the things, it might be fit for use. The only caveat here is that if you find any issue you will be at the mercy of a not-so active mailing list (or perhaps you may want to get your hands dirty with the source code or something like that).
这篇关于pthreads-win32 在各种 Windows 编译器上的可移植性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!