c++ - 采访 : what is the difference between pthread and windows thread created by _beginthread(ex)?

标签 c++ multithreading pthreads beginthread

我在一次 C++ 开发人员职位面试中被问到这个问题,这个问题的答案是什么?

最佳答案

我会说:

If I wanted to create a portable cross-platform C++ binary, I'd use pthreads and use the pthread implementation for windows. If I wanted to create a windows-specific C++ binary, I'd use beginthread and avoid the 3rd party dependency on the pthread library.

如果他们真的想知道描述两者之间差异的复杂内部细节,那么您应该三思而后行。除非是逆向工程工作。

关于c++ - 采访 : what is the difference between pthread and windows thread created by _beginthread(ex)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5345058/

相关文章:

java线程调用耗时的native方法时被阻塞

multithreading - Clojure core.async,有什么方法可以控制该(go...)线程池中的线程数量?

c++ - 如何避免等待信号已发送的 pthread_cond_t

c++ - 优化一个简单的 2D Tile 引擎(+潜在错误修复)

c++ - 我实际上如何在捕获的一半图像上设置光流?

c++ - C++程序的编译阶段是什么?

Java "finalize"线程出现异常

c - pthread 的变量变化

从 C 代码的不同部分调用一个线程函数,既可以是分离的,也可以是可连接的

c++ - SVM 训练矩阵每行的长度