D
D
Dmitry2015-05-15 19:23:30
ASP.NET
Dmitry, 2015-05-15 19:23:30

What is the difference between Parallel and Thread?

Guys, tell me, tell me how Parallel differs from Thread ???

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artur Nurullin, 2015-05-15
@Splo1ter

Parallel uses ThreadPool (in which threads always lie, either wait or work),
and Thread can be created as much as you like, as long as there is enough memory, but you need to take into account that the creation of one thread takes 1 MB of RAM from the computer, so it is better to use Parallel for parallel computing , because creating new threads overhead operation

S
Stanislav Makarov, 2015-05-15
@Nipheris

I would argue that the methods in Parallel operate at a higher level of abstraction, as using them, there is no need to directly take care of creating and maintaining threads for calculations. Actually Parallel uses Tasks, and tasks are an abstraction for asynchronous calculations. A task can be executed both in its own thread and in another, so using threads is one of the options for performing a task. The Thread class itself is nothing more than a one-to-one wrapper around system threads.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question