- 程序有所改变。发帖如还有问题请报告
- 【征集】西西河的经济学,及清流措施,需要主动参与者,『稷下学宫』新认证方式,24年网站打算和努力目标
主题:一个问题请教下 -- 小愚
有没有哪个多核的计算机系统可以自动把单线程
程序自动进行多线分配的?比如一个
for(i=0;i<=10000;i++){}
它可以自动判断,如果可以的话,把进程分配
给各个CPU.然后得到局域加速?
Auto parallelization is a tall billing for any compiler.
I haven't heard of any parallelizing compilers that can
deal with general purpose programs written in C-like
languages using threads.
The closest thing to what you ask is Itanium, which
is based on the VLIW idea. Theoretically, if there is
no dependency between the loops, the compiler will
issue instructions for muliple loops in one shot. Note
the word theoretically. The early product wasn't very
impressive. It might have improved but I don't know.
In addition, languages like HighPerformanceFortran
include additional tags added by the programmer to
guide the compiler's parallelization effort. But those
compilers were originally developed for Vector
computers. I'm not sure if they have been ported
to systems with general-purpose CPUs.
Just my 2c. A compiler or architecture major will
give you a better explanation.
以前在MSDN看到过一篇是介绍这种技术的,你可以看看
要想进一步了解的话,可以上Open MP的总部去看看。