Concurrency Flashcards
What mean “Program” term?
A program, or application, is a brand name. It’s a name that we use to refer to a software package. When we execute a program, the OS creates a process.
What mean “Executable” term?
A file that can be loaded into memory and then run. Running an executable means creating a process and a thread for it, then changing the CPU’s instruction pointer to the first instruction of the executable.
What mean “Task” term?
This chapter uses the term task in an abstract sense. Its meaning shifts as the level of abstraction changes:
a When discussing processes, a task is one of the process’s threads.
b When referring to a thread, a task might be a function call.
c When referring to an OS, a task might be a running program, which might
be comprised of multiple processes.
What mean “Process” term?
Running programs execute as processes. A process has its own vir- tual address space, at least one thread, and lots of bookkeeping managed by the OS. File descriptors, environment variables, and scheduling priorities are managed per process. A process has a virtual address space, executable code, open handles to system objects, a security context, a unique process identi- fier, environment variables, a priority class, minimum and maximum working set sizes, and at least one thread of execution.
Each process is started with a single thread, often called the primary thread, but can create additional threads from any of its threads. Running pro- grams begin their life as a single process, but it isn’t uncommon to spawn subprocesses to do the work.
What mean “Thread” term?
The thread metaphor is used to hint that multiple threads can work together as a whole.
What mean “Thread of execution” term?
A sequence of CPU instructions that appear in serial. Multiple threads can run concurrently, but instructions within the sequence are intended to be executed one after another.
What mean “Coroutine” term?
Also known as fibre, green thread, and lightweight thread, a corou- tine indicates tasks that switch within a thread. Switching between tasks becomes the responsibility of the program itself, rather than the OS. Two the- oretical concepts are important to distinguish:
a Concurrency, which is multiple tasks of any level of abstraction running at the same time
b Parallelism, which is multiple threads executing on multiple CPUs at the same time