SlideShare ist ein Scribd-Unternehmen logo
1 von 4
Difference between Multithreading and Multitasking for Programmers




Page 1 of 4
Page 2 of 4
Why Dataflow Programming Languages are Ideal for Programming Parallel
Hardware (according to ni company)
Dataflow programming models contrast to the control flow model (implemented in languages such as C).
Because of the top-down sequential programming approach, applications written in C have inherent limitations when
mapping to parallel hardware. In contrast, with a dataflow model, nodes on a block diagram are connected to one another to
express the logical execution flow, and they can be used to easily express parallelism. When a block diagram node receives
all required inputs, it produces output data and passes that data to the next node in the dataflow path. The movement of data
through the nodes determines the execution order of the functions on the block diagram.


SOURCE: www.ni.com/multicore
This document is part of the
Multicore Programming Fundamentals Whitepaper Series

Page 3 of 4
“process” is an instance of a computer program that is being executed. While a program itself is just a
passive collection of instructions, a process is something which actually executes those instructions.
Several processes can be associated with the same program - each would execute independently.
Modern computer systems allow multiple processes to be loaded into memory at the same time and,
through time-sharing (or multitasking), give an appearance that they are being executed at the same
time even if there is just one processor.


In modern operating systems, each process can have several threads of execution (or threads for short).
Multiple threads share the same program code, operating system resources (such as memory and file
access) and operating system permissions (for file access as the process they belong to). A process that
has only one thread is referred to as a single-threaded process, while a process with multiple threads is
referred to as a multi-threaded process. Multi-threaded processes have the advantage that they can
perform several tasks concurrently without the extra overhead needed to create a new process and
handle synchronized communication between these processes.

Threads can be thought of as lightweight processes, offering many of the advantages of processes
without the communication requirements that separate processes require. Threads provide a means to
divide the main flow of control into multiple, concurrently executing flows of control.




                  Application / Program


               Task

                                 Proces


                                                   Threa


              Series of Related Instructions




Page 4 of 4

Weitere ähnliche Inhalte

Andere mochten auch

Operating System 5
Operating System 5Operating System 5
Operating System 5tech2click
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating SystemsRitu Ranjan Shrivastwa
 
CPU scheduling algorithms in OS
CPU scheduling algorithms in OSCPU scheduling algorithms in OS
CPU scheduling algorithms in OSharini0810
 
Chapter 6 - Process Synchronization
Chapter 6 - Process SynchronizationChapter 6 - Process Synchronization
Chapter 6 - Process SynchronizationWayne Jones Jnr
 
Virtual Memory and Paging
Virtual Memory and PagingVirtual Memory and Paging
Virtual Memory and PagingEmery Berger
 
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryWayne Jones Jnr
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memorysgpraju
 
Operating System Deadlock Galvin
Operating System  Deadlock GalvinOperating System  Deadlock Galvin
Operating System Deadlock GalvinSonali Chauhan
 
Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)Vaibhav Bajaj
 
Deep Dive: Memory Management in Apache Spark
Deep Dive: Memory Management in Apache SparkDeep Dive: Memory Management in Apache Spark
Deep Dive: Memory Management in Apache SparkDatabricks
 
Microsoft word presentation
Microsoft word presentationMicrosoft word presentation
Microsoft word presentationegirshovich
 

Andere mochten auch (17)

Operating System 5
Operating System 5Operating System 5
Operating System 5
 
Paging and segmentation
Paging and segmentationPaging and segmentation
Paging and segmentation
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
 
CPU scheduling algorithms in OS
CPU scheduling algorithms in OSCPU scheduling algorithms in OS
CPU scheduling algorithms in OS
 
Process Scheduling
Process SchedulingProcess Scheduling
Process Scheduling
 
Chapter 6 - Process Synchronization
Chapter 6 - Process SynchronizationChapter 6 - Process Synchronization
Chapter 6 - Process Synchronization
 
Virtual Memory and Paging
Virtual Memory and PagingVirtual Memory and Paging
Virtual Memory and Paging
 
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual Memory
 
Virtual memory ppt
Virtual memory pptVirtual memory ppt
Virtual memory ppt
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memory
 
CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling Algorithms
 
Operating System Deadlock Galvin
Operating System  Deadlock GalvinOperating System  Deadlock Galvin
Operating System Deadlock Galvin
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
 
Memory management
Memory managementMemory management
Memory management
 
Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)
 
Deep Dive: Memory Management in Apache Spark
Deep Dive: Memory Management in Apache SparkDeep Dive: Memory Management in Apache Spark
Deep Dive: Memory Management in Apache Spark
 
Microsoft word presentation
Microsoft word presentationMicrosoft word presentation
Microsoft word presentation
 

Simple difference multi_threading_tasking

  • 1. Difference between Multithreading and Multitasking for Programmers Page 1 of 4
  • 3. Why Dataflow Programming Languages are Ideal for Programming Parallel Hardware (according to ni company) Dataflow programming models contrast to the control flow model (implemented in languages such as C). Because of the top-down sequential programming approach, applications written in C have inherent limitations when mapping to parallel hardware. In contrast, with a dataflow model, nodes on a block diagram are connected to one another to express the logical execution flow, and they can be used to easily express parallelism. When a block diagram node receives all required inputs, it produces output data and passes that data to the next node in the dataflow path. The movement of data through the nodes determines the execution order of the functions on the block diagram. SOURCE: www.ni.com/multicore This document is part of the Multicore Programming Fundamentals Whitepaper Series Page 3 of 4
  • 4. “process” is an instance of a computer program that is being executed. While a program itself is just a passive collection of instructions, a process is something which actually executes those instructions. Several processes can be associated with the same program - each would execute independently. Modern computer systems allow multiple processes to be loaded into memory at the same time and, through time-sharing (or multitasking), give an appearance that they are being executed at the same time even if there is just one processor. In modern operating systems, each process can have several threads of execution (or threads for short). Multiple threads share the same program code, operating system resources (such as memory and file access) and operating system permissions (for file access as the process they belong to). A process that has only one thread is referred to as a single-threaded process, while a process with multiple threads is referred to as a multi-threaded process. Multi-threaded processes have the advantage that they can perform several tasks concurrently without the extra overhead needed to create a new process and handle synchronized communication between these processes. Threads can be thought of as lightweight processes, offering many of the advantages of processes without the communication requirements that separate processes require. Threads provide a means to divide the main flow of control into multiple, concurrently executing flows of control. Application / Program Task Proces Threa Series of Related Instructions Page 4 of 4