Please enable JavaScript.
Coggle requires JavaScript to display documents.
Threads (Benefits (Responsiveness (Multithreading in an interactive…
Threads
Benefits
Responsiveness
Multithreading in an interactive application can allow a program to continue running even if part of it is blocked or paused. This increases the responsiveness to the user.
Resource sharing
Threads share the memory and resources of the process to which they belong. This lets an application be able to have several threads.
Economy
Threads share the resources of the process to which they belong. It is more economical to create a thread and do context switching.
Scalability
In a multiprocessor architecture the advantages are even greater. Multiple threads can run at the same time so it implements parallel processing which is very efficient.
Threading Issues
Signal Handling
-
A signal may receive synchronously or asynchronously, depending on the source and the reason of the event signaled
Thread Cancellation
Involves terminating a thread before it has completed. A thread to be cancelled is referred to as the targeted thread.
-
Scheduler Activations
One scheme for communication between the user thread library and the kernel is known as scheduler activation.
Multicore Programming
When a system has multiple cores across its chips or inside the CPU chips it is called multicore or multiprocessor. Each core is a processor.
Multithreading provides a mechanism for a more efficient use of the multiple cores in a single computer.
Since multithreading and multiprogramming have been advancing at such a big pace the manufacturers of computers had to develop hardware to improve performance in threads.
Multithreading Models
-
One to One Model
Maps each user thread to one kernel thread. It allows more concurrency by allowing other threads to run even if a thread of the same process did a blocking system call.
-
Many to Many Model
-
When a thread performs a blocking system call then the model can schedule another thread for execution
A thread is a basic unit of CPU utilization. It contains a thread ID, a program counter, a register set, and a stack.