Thread Flashcards
Most modern applications
are multithreaded
Threads run
within application
Multiple tasks with the application can be implemented by separate threads
Update display
Fetch data
Spell checking
Answer a network request
Process creation is heavy-weight
while thread creation is light-weight
Kernels are generally
multithreaded
Benefits of thread
Responsiveness,
Resource Sharing
Economy
Scalability
Responsiveness
may allow continued execution if part of the process is blocked, especially important for user interfaces
Resource Sharing
threads share resources of process, easier than shared memory or message passing
Economy
cheaper than process creation, thread switching lower overhead than context switching
Scalability
the process can take advantage of multiprocessor architectures
Multi core or multiprocessor systems putting pressure on programmers, challenges include:
Dividing activities Balance Data splitting Data dependency Testing and debugging
Parallelism
implies a system can perform more than one task simultaneously
Concurrency
supports more than one task making progress
Types of parallelism
Data parallelism
Task parallelism
Data parallelism
distributes subsets of the same data across multiple cores, same operation on each