Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is parallel programming == multithread programming?

Is parallel programming == multithread programming?

like image 553
Eko Kurniawan Khannedy Avatar asked Feb 18 '10 10:02

Eko Kurniawan Khannedy


People also ask

Is parallel programming the same as multithreading?

Parallel programming is a broad concept. It can describe many types of processes running on the same machine or on different machines. Multithreading specifically refers to the concurrent execution of more than one sequential set (thread) of instructions.

Is multithreading synchronous or parallel?

What Is Multithreading Programming? Multithreading refers to the concurrent/parallel execution of more than one sequential set (thread) of instructions. On a single processor, multithreading gives the illusion of running in parallel. In reality, the processor is switching by using a scheduling algorithm.

Which programming is multithreaded?

In multithreaded programs, the same functions and the same resources may be accessed concurrently by several flows of control. Developing multithreaded programs is similar to developing programs with multiple processes. Developing programs also consists of compiling and debugging the code.

Are threads run in parallel?

On a single core microprocessor (uP), it is possible to run multiple threads, but not in parallel. Although conceptually the threads are often said to run at the same time, they are actually running consecutively in time slices allocated and controlled by the operating system.


2 Answers

Multithreaded programming is parallel, but parallel programming is not necessarily multithreaded.

Unless the multithreading occurs on a single core, in which case it is only concurrent.

like image 57
Lucas Lindström Avatar answered Sep 21 '22 05:09

Lucas Lindström


Not necessarily. You can distribute jobs between multiple processes and even multiple machines - I wouldn't class that as "multi-threaded" programming as each process may only use a single thread, but it's certainly parallel programming. Admittedly you could then argue that with multiple processes there are multiple threads within the system as a whole...

Ultimately, definitions like this are only useful within a context. In your particular case, what difference is it going to make? Or is this just out of interest?

like image 36
Jon Skeet Avatar answered Sep 21 '22 05:09

Jon Skeet