Operating SystemsCh4 Threads1
Operating Systems 1 Ch4 Threads
Chapter 4:Threads· Thread Concepts- Why use threads-StructureinMemory-BenefitsandChallenges- Thread ModelsProgramming-Basic Programming:Pthreads Library-Implicit Threading:ThreadPools&OpenMP2
Chapter 4: Threads • Thread Concepts – Why use threads – Structure in Memory – Benefits and Challenges – Thread Models • Programming – Basic Programming: Pthreads Library – Implicit Threading: Thread Pools & OpenMP 2
Multi-threading- Motivation3
3 Multi-threading - Motivation
Motivation-Application Side· Most software applications are multithreaded, eachapplication is implemented as a process withseveral threads of control-Webbrowser: displays images, retrieve data from network-Wordprocessor? display graphics, respond to keystrokes, spelling & grammarchecking4
Motivation - Application Side • Most software applications are multithreaded, each application is implemented as a process with several threads of control – Web browser • displays images, retrieve data from network – Word processor • display graphics, respond to keystrokes, spelling & grammar checking 4
Motivation-ApplicationSide: Most software applications are multithreaded-Webbrowser-Wordprocessor- Similar tasks in a single application (web server)·Acceptclientrequests,servicethereguests·Usuallyservethousandsof clients(2) create new(1) requestthreadto servicethe requestclientthreadserver(3) resume listeningforadditionalclient requests5
Motivation - Application Side • Most software applications are multithreaded – Web browser – Word processor – Similar tasks in a single application (web server) • Accept client requests, service the requests • Usually serve thousands of clients 5