哪些x86 C ++编译器本身是多线程的? [英] Which x86 C++ compilers are multithreaded by itself?

查看:242
本文介绍了哪些x86 C ++编译器本身是多线程的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在几乎每个用户在桌面(和大量笔记本电脑)上有2或4个内核。

Now almost an every user have a 2 or 4 cores on desktop (and on high number of notebooks). Power users have 6-12 cores with amd or i7.

哪些x86 / x86_64 C / C ++编译器可以使用多个线程来进行编译?

Which x86/x86_64 C/C++ compilers can use several threads to do the compilation?

已经有一个'make -j N'的解决方案,但有时( -fwhole-program -ipo )有最后一个大和慢的步骤,顺序启动。

There is already a 'make -j N'-like solutions, but sometimes (for -fwhole-program or -ipo) there is the last big and slow step, which started sequentially.

这些都可以:GCC,Intel C ++编译器,Borland C ++编译器,Open64,LLVM / GCC,LLVM / Clang,Sun编译器,MSVC,OpenWatcom,Pathscale,PGI,TenDRA,Digital Mars?

Does any of these can: GCC, Intel C++ Compiler, Borland C++ compiler, Open64, LLVM/GCC, LLVM/Clang, Sun compiler, MSVC, OpenWatcom, Pathscale, PGI, TenDRA, Digital Mars ?

编译器的线程数是否有多线程限制?

Is there some higher limit of thread number for compilers, which are multithreaded?

谢谢! >

Thanks!

推荐答案

一些构建系统可以并行编译独立的模块,但编译器本身仍然是单线程的。我不知道有什么可以通过使编译器多线程获得。最耗时的编译阶段是处理所有#include依赖性,并且由于各种头之间的潜在依赖性,它们被顺序处理。其他编译阶段严重依赖于之前阶段的输出,因此从并行化中获得的好处很少。

Some build systems can compile independent modules in parallel, but the compilers themselves are still single-threaded. I'm not sure there is anything to gain by making the compiler multi-threaded. The most time-consuming compilation phase is processing all the #include dependencies and they have to be processed sequentially because of potential dependencies between the various headers. The other compilation phases are heavily dependent on the output of previous phases so there's little benefit to be gained from parallelism there.

这篇关于哪些x86 C ++编译器本身是多线程的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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