c++ - 使用 visual stdio2008 的线程

标签 c++ windows visual-studio multithreading pthreads

我想在 C++ 中实现线程。我正在使用 visual stdio2008 并希望使用 pthreads 实现线程。任何人都可以指导我关于 pthreads 以及 vs2008 中的实现。感谢期待

最佳答案

为什么要在 Windows 上的 C++ 中使用通常用于 *nix (pthreads) 的普通 C API (pthreads)?任何其他原因……随便。

使用 boost.thread。它在 windows 上使用 windows 线程,在 posix 平台上使用 pthread。它运行良好,并且便于携带。

如果您真的想使用 pthread,您将使用 Microsoft Windows Services for UNIX 之类的东西。不过,我从未尝试过。

关于c++ - 使用 visual stdio2008 的线程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1318533/

相关文章:

visual-studio - 如何禁用(或更改)评论中的关键字突出显示?

c# - VStudio 2019 中缺少 “Merge changes in merge tool” 、 “Take server version” 等按钮

c++ - 构造虚拟基类时的编译器行为

c++ - 如何将 QIcon 转换为 QPixmap

windows - 使用 Windows cmd.exe 从 FTP 服务器复制到网络服务器

c++ - cuda中的数学函数

windows - 补丁和服务包如何工作?

windows - SHAutoComplete 和当前工作目录?

c++ - 在 linux 和 mac 上始终将应用程序窗口保留在当前桌面上

C++ - 从 valgrind 中删除无效