我的看法是,基本上「OS」作業系統仍然是輪循式的處理各種「程序」,而「程序」中包含許多的「執行緒」 所以要先知道何謂「程序」,和「執行緒」 在Windows 工作管理員中「處理程序」中就記錄著許多著「程序」,而這些「程序」是一一排對等後著被 CPU 執行, CPU 一次也只能處理一個「程序」,可以調整優先權,但此「程序」被 CPU 排班的次數多一些。 將「程序」一開始進入 CPU 被處理時被分成許多的「執行緒」,這時候便可以開始發揮多核心的效果了,多個「執行緒」便在不同的 CPU內執行,達到可以彼此共享記憶體,等到這一個 CPU 執行週期結束後,將這所有的結果及狀態儲存起來,將執行權交由下一個「程序」處理。幾個「程序」不斷的輪流執行稱為「輪循」。 「程式」的執行接需交由「作業系統」去載入至記憶體轉為「程序」去執行,而非程式直接就能執行。 Microsoft Windows 的機制為 輪循 + 優先權 的 CPU 排班方式。 所以多核心一般與「程式」較無相關,除非是較低階的程式,而是與程式執行的平台較為相關。
At this week's Intel Developer Forum (IDF), Intel announced a forthcoming beta of new tools designed to optimize software for multicore processors. Intel Parallel Studio will help Microsoft Visual Studio developers design, code, debug, and tune applications to use parallel programming techniques, according to the company.
(Click here for a larger view of Intel's Parallel Studio)
Today, the vast majority of Intel processors have two or four cores, with even more on the way. Yet, as the company concedes in a FAQ released to promote Parallel Studio, few applications outside the specialized world of technical computing take any advantage of multiple cores. "There is an opportunity for Intel to help by bringing Intel's parallelism experience to more developers in the form of products to complement and extend Microsoft Visual Studio for parallelism," the company says.
Parallel Studio will be a suite of five plug-ins for Visual Studio, designed for developers who write some or all of their software in Microsoft's Visual C++, says Intel. The plug-ins are touted as benefiting developers who want to take advantage of multicore CPUs, but who are also concerned about backward compatibility.
The plug-ins, as described by Intel, are: Parallel Composer, which speeds software development incorporating parallelism with a C/C++ compiler, comprehensive threaded libraries, and support for a "broad array" of programming models
Parallel Inspector, a "proactive bug finder" that adds reliability, detecting hard-to-find threading errors in multi-threaded C/C++ Windows applications, and doing root-cause analysis for defects such as data races and deadlocks
Parallel Amplifier, which assists in fine-tuning parallel applications for optimal performance by helping find unexpected serialization that limits scaling
Parallel Advisor, which helps a developer understand where to add parallelism to existing source code, shows the consequences of decisions, and helps resolve any conflicts The plug-ins can be used separately or together, says Intel. They not only require Visual Studio, but are fully interoperable with its compiler, libraries, and debugger, the company adds.
According to Intel, the Parallel Composer plug-in will support the OpenMP 3.0 API (application programming inteface), lambda functions, auto-vectorization, spawn, and threaded libraries. A key component of Parallel Composer is said to be Intel's Threading Building Blocks (TBB). Rev'd to version 2.1 in July, TBB is a cross-platform, portable library that comprises a 120KB runtime combined with "template libraries" linked in at compile time, says Intel.
Addressing the difference between TBB and Parallel Composer, Intel says Parallel Composer "will cater to Windows C++ developers focused on new parallel implementations of their software using Microsoft Visual Studio. Features such as support for Linux and Mac OS, Fortran, as well as advanced levels of optimizations and optimizer controls, will remain unique to the existing compiler products."
Further information
The Parallel Composer, Parallel Inspector, and Parallel Amplifier components of Parallel Studio will be offered via a free beta program that begins in November, and will run through May 2009, Intel says. The Parallel Advisor will enter beta "later in 2009."
To obtain the beta products as soon as they are ready, receive product information, and participate in related online forums, registration is required, here. Qualifying for the beta requires current use of Microsoft's Visual Studio 2005 or 2008, not including Express editions, C/C++, and Windows XP or Vista.