A few days ago I wrote a post about how the number of threads affects the speed of calculations. In the comments, I was repeatedly accused of using only one core (or one processor) when using threads, and Parallel Extensions should be used for enlightened multi-core programming. These statements, to put it mildly, surprised me, so I decided to sort out the issue in more detail.
Thread .
In the Russian version of
MSDN -
"stream" , which introduces some confusion. Therefore, I will use the term
“thread” to designate Thread, which is also more or less well-established. Again,
Lingvo interprets it quite clearly: “4) computer. thread, trad (in multi-tasking environments: a subprocess triggered by another process in the address space of this (triggering) process) ”.
The relationship between the
process and the
thread .
Turn to
MSDN and establish a connection between threads and processes.
A process is a collection of virtual space of memory, code, data, and system resources. A thread is a code that is sequentially executed within a process. The processor executes threads, not processes, i.e. Any 32-bit application has at least one process, and a process always has at least one execution thread known as the main thread.
Again, refer to the recommendations of
AMD already in 2006, whose processor showed strange results. “Use the various thread objects available in the .Net Framework, such as the System.Threading namespace, Thread Class, ...”
')
Finally, we turn on the logic and understand that Parallel Extentions is not yet a release, the project was launched at the end of 2007, and multi-core processors have already been put to work places. What PE was created for - “It was created so that developers could use modern multi-core architectures without bothering themselves with time-consuming thread management.”
About Parallel Extensions there is a good
post from
3fonov