Multithreading Flashcards
Learn concepts that the understanding of multithreading (43 cards)
What does the preprocessor do in the program creation process?
It processes directives (e.g., macros, file inclusions, conditional compilations) to transform the source code before compilation.
What is the role of the compiler in program creation?
The compiler translates source code into machine code by performing syntax and semantic analysis, optimizations, and code generation.
What does an assembler do in the program creation process?
It converts assembly language code into machine code by translating mnemonic instructions into binary representations.
What is the function of the linker in program creation?
The linker combines object files into a single executable by resolving external symbols and organizing the memory layout.
What is a thread?
A thread is the smallest unit of execution within a process, managed by the scheduler.
How is parallelism defined in computing?
Parallelism is the simultaneous execution of multiple computations or processes to improve performance.
What does concurrency mean in computing?
Ability to manage multiple tasks at the same time and switch between them as needed
What is data parallelism?
It is the execution of the same operation concurrently on different pieces of distributed data.
What is task parallelism?
Task parallelism is the concurrent execution of different tasks or functions that perform distinct operations independently.
What are kernel threads?
Kernel threads are threads managed directly by the operating system, which handles their scheduling and resource allocation.
What are user threads?
User threads are threads managed by a user-level library rather than directly by the operating system.
What is the many-to-one threading model?
It is a model where many user-level threads are mapped to a single kernel thread.
What is the purpose of the many-to-one threading model?
Its purpose is to simplify thread management at the user level.
What is one advantage of the many-to-one threading model?
It offers efficient context switching with less overhead.
What is one disadvantage of the many-to-one threading model?
A blocking system call can block all threads, and it cannot utilize multiple processors concurrently.
What is the one-to-one threading model?
It is a model where each user-level thread is mapped to a unique kernel thread.
What is the purpose of the one-to-one threading model?
Its purpose is to allow true parallel execution on multiprocessor systems.
What is one advantage of the one-to-one threading model?
It provides better concurrency and true parallelism.
What is one disadvantage of the one-to-one threading model?
It increases overhead and consumes more system resources due to managing many kernel threads.
What is the many-to-many threading model?
It is a model where many user threads are mapped to many kernel threads.
What is the purpose of the many-to-many threading model?
Its purpose is to combine the benefits of user-level and kernel-level threading by providing flexible scheduling.
What is one advantage of the many-to-many threading model?
It allows efficient resource use and flexible scheduling of threads.
What is one disadvantage of the many-to-many threading model?
Its implementation is more complex and may introduce mapping overhead.
What are Pthreads?
Pthreads (POSIX Threads) is a standardized API for creating and managing threads in UNIX-like operating systems.