Module 1 Flashcards
What is the difference between multitasking and multithreading?
Multitasking is when several applications seem to run at the same time.
Multithreading is a form of multitasking within an application.
What is concurrent programming?
Concurrent programming is to make two or more task seemingly (almost) execute at the same time. (Sharing the computers CPU)
What is parallel programming?
Parallel programming is when two or more tasks run exactly at the same time. (Not sharing the computers CPU).
What is a process?
An instance of an application being executed.
What does a process consist of?
Program instructions to the machine.
Stack memory (call stack) - to keep track of active methods.
A heap memory.
A program counter (register).
Other resources, security information, information about the state of the process etc.
Is a process isolated from other processes?
Yes, a process runs in it’s own address space managed by OS and is totally isolated from other processes.
What is a thread?
A single sequential flow of control within a program
What does all threads within the same process share?
Adress space, code and data
What’s the difference between threads and processes?
A process is the execution of a program, isolated from other processes. It runs in its own memory space.
A thread runs within the address space of a process. It is a execution of the whole or parts of a program. Threads share the process memory area.
Does every process has a thread?
Yes, every process has at least one thread. More threads can be created in the process.
What is concurrency?
A property of a computing system in which several tasks are executing simultaneously. Systems are (or seem to be) progressing at the same time.
Running several programs at the same time is an example.
Name two types of concurrency
Multithreading and parallel programming
What is a sequential application?
A sequential application has one single thread of execution.
A sequence of statements that are executed one after another.
True or false:
A concurrent application has multiple threads of execution.
True
True or false:
A sequential application has one single thread of execution.
True