Week 5 MultiThreading Flashcards
What is a thread?
The smallest unit of execution within a process.
What are the advantages of using threads? List at least three.
- Easy to create and handle
- Achieve concurrency in parallel programming
- Reduce context switching time in an operating system
What is the difference between kernel-level threads and user-level threads?
Kernel-level threads are managed by the operating system, while user-level threads are managed by the user through thread libraries.
Fill in the blank: User-level threads are created with ______ instead of system calls.
[thread libraries]
What are some examples of user-level threads?
- POSIX threads
- Java threads
What is a disadvantage of user-level threads?
Multiprocessing is very difficult because it is independent of the kernel.
What examples illustrate kernel-level threads?
- Win32
- Solaris
True or False: Kernel-level threads are easier to create and manage compared to user-level threads.
False
What is the definition of a process?
Any program or software that is executing.
What is the creation time comparison between threads and processes?
Threads usually take very little time to create, while processes require more time.
What is the memory sharing behavior between threads and processes?
Threads share memory with other threads, while all processes are isolated.
Fill in the blank: Multithreading is a program’s ability to execute multiple threads ______.
[simultaneously]
What is the difference between concurrency and parallelism?
Concurrency involves tasks that execute simultaneously but not at the same time, while parallelism involves tasks that execute simultaneously and at the same time.
What is concurrency?
A mechanism that decreases the response time of the system by using a single processing unit.
What is parallelism?
A mechanism that increases computational speed by using multiple processors.
What is the role of the CPU in relation to threads?
The CPU is a hardware component that executes and reads program instructions.
What is the relationship between threads and processing units?
Threads require multiple processing units, while the CPU requires a single processing unit.
True or False: Threads improve the throughput and computation speed.
True
What is the task of threads?
To achieve concurrency.
What are some benefits of multithreading? List at least two.
- Efficient resource sharing
- Application scalability