SlideShare a Scribd company logo
1 of 24
Download to read offline
Lecture 3
                 Processes and Threads

                 3.1. Processes
                 3.2. Threads




Sistem Operasi           http://fasilkom.narotama.ac.id/
                                                           1
Processes
                   The Process Model




• Multiprogramming of four programs
• Conceptual model of 4 independent, sequential processes
• Only one program active at any instant
  Sistem Operasi     http://fasilkom.narotama.ac.id/
                                                            2
Process Creation

Principal events that cause process creation
1. System initialization
• Execution of a process creation system
1. User request to create a new process
2. Initiation of a batch job



Sistem Operasi     http://fasilkom.narotama.ac.id/
                                                     3
Process Termination

Conditions which terminate processes
1. Normal exit (voluntary)
2. Error exit (voluntary)
3. Fatal error (involuntary)
4. Killed by another process (involuntary)



Sistem Operasi       http://fasilkom.narotama.ac.id/
                                                       4
Process Hierarchies

• Parent creates a child process, child processes
  can create its own process
• Forms a hierarchy
     – UNIX calls this a "process group"
• Windows has no concept of process hierarchy
     – all processes are created equal


Sistem Operasi       http://fasilkom.narotama.ac.id/
                                                       5
Process States (1)




             • Possible process states
                 – running
                 – blocked
                 – ready
             • Transitions between states shown
Sistem Operasi         http://fasilkom.narotama.ac.id/
                                                         6
Process States (2)




 • Lowest layer of process-structured OS
       – handles interrupts, scheduling
 • Above that layer are sequential processes
Sistem Operasi        http://fasilkom.narotama.ac.id/
                                                        7
Implementation of Processes (1)




Sistem Operasi
                 Fields of a process table entry
                         http://fasilkom.narotama.ac.id/
                                                           8
Implementation of Processes (2)




Skeleton of what lowest level of OS does when an
    interrupt occurs
Sistem Operasi    http://fasilkom.narotama.ac.id/
                                                    9
Threads
               The Thread Model (1)




(a) Three processes each with one thread
(b) Operasi process with three threads
Sistem
       One          http://fasilkom.narotama.ac.id/
                                                      10
The Thread Model (2)




• Items shared by all threads in a process
• Items private to each thread
Sistem Operasi        http://fasilkom.narotama.ac.id/
                                                        11
The Thread Model (3)




                 Each thread has its own stack
Sistem Operasi          http://fasilkom.narotama.ac.id/
                                                          12
Thread Usage (1)




          A word processor with three threads
Sistem Operasi       http://fasilkom.narotama.ac.id/
                                                       13
Thread Usage (2)




Sistem Operasi
                 A multithreaded Web server
                       http://fasilkom.narotama.ac.id/
                                                         14
Thread Usage (3)




• Rough outline of code for previous slide
     (a) Dispatcher thread
     (b) Worker thread
Sistem Operasi      http://fasilkom.narotama.ac.id/
                                                      15
Thread Usage (4)




                 Three ways to construct a server


Sistem Operasi            http://fasilkom.narotama.ac.id/
                                                            16
Implementing Threads in User Space




                  A user-level threads package
 Sistem Operasi         http://fasilkom.narotama.ac.id/
                                                          17
Implementing Threads in the Kernel




      A threads package managed by the kernel
 Sistem Operasi    http://fasilkom.narotama.ac.id/
                                                     18
Hybrid Implementations




      Multiplexing user-level threads onto kernel-
Sistem Operasi threads
     level             http://fasilkom.narotama.ac.id/
                                                         19
Scheduler Activations

• Goal – mimic functionality of kernel threads
     – gain performance of user space threads
• Avoids unnecessary user/kernel transitions
• Kernel assigns virtual processors to each process
     – lets runtime system allocate threads to processors
• Problem:
    Fundamental reliance on kernel (lower layer)
    calling procedures in user space (higher layer)

Sistem Operasi         http://fasilkom.narotama.ac.id/
                                                            20
Pop-Up Threads




• Creation of a new thread when message arrives
    (a) before message arrives
    (b) after messagehttp://fasilkom.narotama.ac.id/
Sistem Operasi
                       arrives                         21
Making Single-Threaded Code Multithreaded (1)




Conflicts between threads over the use of a global variable
  Sistem Operasi     http://fasilkom.narotama.ac.id/
                                                              22
Making Single-Threaded Code Multithreaded (2)




      Threads can have private global variables
 Sistem Operasi    http://fasilkom.narotama.ac.id/
                                                     23
Discussion / Question




Sistem Operasi        http://fasilkom.narotama.ac.id/
                                                        24

More Related Content

What's hot

Introduction to Linux Kernel by Quontra Solutions
Introduction to Linux Kernel by Quontra SolutionsIntroduction to Linux Kernel by Quontra Solutions
Introduction to Linux Kernel by Quontra SolutionsQUONTRASOLUTIONS
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/CoreShay Cohen
 
Linux Kernel Tour
Linux Kernel TourLinux Kernel Tour
Linux Kernel Toursamrat das
 
Operating Systems - "Chapter 4: Multithreaded Programming"
Operating Systems - "Chapter 4:  Multithreaded Programming"Operating Systems - "Chapter 4:  Multithreaded Programming"
Operating Systems - "Chapter 4: Multithreaded Programming"Ra'Fat Al-Msie'deen
 
Linux Kernel Programming
Linux Kernel ProgrammingLinux Kernel Programming
Linux Kernel ProgrammingNalin Sharma
 
Operating system kernal
Operating system kernalOperating system kernal
Operating system kernalSumit Rajpal
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modulesEddy Reyes
 
Hardware Probing in the Linux Kernel
Hardware Probing in the Linux KernelHardware Probing in the Linux Kernel
Hardware Probing in the Linux KernelKernel TLV
 
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteUnit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteTushar B Kute
 
KERNAL ARCHITECTURE
KERNAL ARCHITECTUREKERNAL ARCHITECTURE
KERNAL ARCHITECTURElakshmipanat
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System CallsVandana Salve
 

What's hot (20)

Linux kernel architecture
Linux kernel architectureLinux kernel architecture
Linux kernel architecture
 
Introduction to Linux Kernel by Quontra Solutions
Introduction to Linux Kernel by Quontra SolutionsIntroduction to Linux Kernel by Quontra Solutions
Introduction to Linux Kernel by Quontra Solutions
 
1 introduction
1 introduction1 introduction
1 introduction
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
 
Linux Kernel Tour
Linux Kernel TourLinux Kernel Tour
Linux Kernel Tour
 
Kernal
KernalKernal
Kernal
 
Operating Systems - "Chapter 4: Multithreaded Programming"
Operating Systems - "Chapter 4:  Multithreaded Programming"Operating Systems - "Chapter 4:  Multithreaded Programming"
Operating Systems - "Chapter 4: Multithreaded Programming"
 
Kernel module in linux os.
Kernel module in linux os.Kernel module in linux os.
Kernel module in linux os.
 
Linux Kernel Programming
Linux Kernel ProgrammingLinux Kernel Programming
Linux Kernel Programming
 
Window ce
Window ceWindow ce
Window ce
 
Operating system kernal
Operating system kernalOperating system kernal
Operating system kernal
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modules
 
Hardware Probing in the Linux Kernel
Hardware Probing in the Linux KernelHardware Probing in the Linux Kernel
Hardware Probing in the Linux Kernel
 
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteUnit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
 
In a monolithic kernel
In a monolithic kernelIn a monolithic kernel
In a monolithic kernel
 
Basic Linux kernel
Basic Linux kernelBasic Linux kernel
Basic Linux kernel
 
KERNAL ARCHITECTURE
KERNAL ARCHITECTUREKERNAL ARCHITECTURE
KERNAL ARCHITECTURE
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System Calls
 
2. microkernel new
2. microkernel new2. microkernel new
2. microkernel new
 
4 threads
4 threads4 threads
4 threads
 

Viewers also liked

contoh Kisi-kisi evaluasi PHB
contoh Kisi-kisi evaluasi PHBcontoh Kisi-kisi evaluasi PHB
contoh Kisi-kisi evaluasi PHBDasrieny Pratiwi
 
Lets Remember the Heroes
Lets Remember the HeroesLets Remember the Heroes
Lets Remember the Heroessiddharthsetia
 
Jim Marks Twitter Deck
Jim Marks Twitter DeckJim Marks Twitter Deck
Jim Marks Twitter DeckJim Marks
 
The Federal Regulation Of Insurance
The Federal Regulation Of InsuranceThe Federal Regulation Of Insurance
The Federal Regulation Of InsuranceTony Roehl
 
Werkgroep Business Models Stichting
Werkgroep Business Models StichtingWerkgroep Business Models Stichting
Werkgroep Business Models Stichtinguw84me2
 
High Altitude Food Gardening - Evergreen Library 2/13/16
High Altitude Food Gardening - Evergreen Library 2/13/16High Altitude Food Gardening - Evergreen Library 2/13/16
High Altitude Food Gardening - Evergreen Library 2/13/16Web Sites for Good
 
Green Viewpoint Q3-2010
Green Viewpoint Q3-2010Green Viewpoint Q3-2010
Green Viewpoint Q3-2010scottbrooker
 
Second Quarter Review
Second Quarter ReviewSecond Quarter Review
Second Quarter Reviewcharsh
 
The science of productive breaks
The science of productive breaksThe science of productive breaks
The science of productive breaksWrike
 
Douglas Crockford Presentation Goodparts
Douglas Crockford Presentation GoodpartsDouglas Crockford Presentation Goodparts
Douglas Crockford Presentation GoodpartsAjax Experience 2009
 
Precisando de uma ferramenta gerencial eficiente e que simplifique as tarefas?
Precisando de uma ferramenta gerencial eficiente e que simplifique as tarefas?Precisando de uma ferramenta gerencial eficiente e que simplifique as tarefas?
Precisando de uma ferramenta gerencial eficiente e que simplifique as tarefas?AgriPoint
 
Time Marches On
Time Marches OnTime Marches On
Time Marches Oncharsh
 
Leaders and followers ann grand - open university - easst 2014
Leaders and followers   ann grand - open university - easst 2014Leaders and followers   ann grand - open university - easst 2014
Leaders and followers ann grand - open university - easst 2014agrand
 
Earth And Moon Jeopardy Review
Earth And Moon Jeopardy ReviewEarth And Moon Jeopardy Review
Earth And Moon Jeopardy Reviewcharsh
 
Ted Husted Api Doc Smackdown Ae2009
Ted Husted Api Doc Smackdown Ae2009Ted Husted Api Doc Smackdown Ae2009
Ted Husted Api Doc Smackdown Ae2009Ajax Experience 2009
 

Viewers also liked (20)

contoh Kisi-kisi evaluasi PHB
contoh Kisi-kisi evaluasi PHBcontoh Kisi-kisi evaluasi PHB
contoh Kisi-kisi evaluasi PHB
 
Lets Remember the Heroes
Lets Remember the HeroesLets Remember the Heroes
Lets Remember the Heroes
 
4.2 voorlichting
4.2 voorlichting4.2 voorlichting
4.2 voorlichting
 
Jim Marks Twitter Deck
Jim Marks Twitter DeckJim Marks Twitter Deck
Jim Marks Twitter Deck
 
Chapter07
Chapter07Chapter07
Chapter07
 
The Federal Regulation Of Insurance
The Federal Regulation Of InsuranceThe Federal Regulation Of Insurance
The Federal Regulation Of Insurance
 
Kurikulum 2013 SD
Kurikulum 2013 SD Kurikulum 2013 SD
Kurikulum 2013 SD
 
Werkgroep Business Models Stichting
Werkgroep Business Models StichtingWerkgroep Business Models Stichting
Werkgroep Business Models Stichting
 
High Altitude Food Gardening - Evergreen Library 2/13/16
High Altitude Food Gardening - Evergreen Library 2/13/16High Altitude Food Gardening - Evergreen Library 2/13/16
High Altitude Food Gardening - Evergreen Library 2/13/16
 
Kurikulum 2013 SMP
Kurikulum 2013 SMPKurikulum 2013 SMP
Kurikulum 2013 SMP
 
Green Viewpoint Q3-2010
Green Viewpoint Q3-2010Green Viewpoint Q3-2010
Green Viewpoint Q3-2010
 
Second Quarter Review
Second Quarter ReviewSecond Quarter Review
Second Quarter Review
 
The science of productive breaks
The science of productive breaksThe science of productive breaks
The science of productive breaks
 
Douglas Crockford Presentation Goodparts
Douglas Crockford Presentation GoodpartsDouglas Crockford Presentation Goodparts
Douglas Crockford Presentation Goodparts
 
Precisando de uma ferramenta gerencial eficiente e que simplifique as tarefas?
Precisando de uma ferramenta gerencial eficiente e que simplifique as tarefas?Precisando de uma ferramenta gerencial eficiente e que simplifique as tarefas?
Precisando de uma ferramenta gerencial eficiente e que simplifique as tarefas?
 
Time Marches On
Time Marches OnTime Marches On
Time Marches On
 
Facts About Swine Flu
Facts About Swine FluFacts About Swine Flu
Facts About Swine Flu
 
Leaders and followers ann grand - open university - easst 2014
Leaders and followers   ann grand - open university - easst 2014Leaders and followers   ann grand - open university - easst 2014
Leaders and followers ann grand - open university - easst 2014
 
Earth And Moon Jeopardy Review
Earth And Moon Jeopardy ReviewEarth And Moon Jeopardy Review
Earth And Moon Jeopardy Review
 
Ted Husted Api Doc Smackdown Ae2009
Ted Husted Api Doc Smackdown Ae2009Ted Husted Api Doc Smackdown Ae2009
Ted Husted Api Doc Smackdown Ae2009
 

Similar to Kcd226 Sistem Operasi Lecture03

Kcd226 Sistem Operasi Lecture02
Kcd226 Sistem Operasi Lecture02Kcd226 Sistem Operasi Lecture02
Kcd226 Sistem Operasi Lecture02Cahyo Darujati
 
Kcd226 Sistem Operasi Lecture04
Kcd226 Sistem Operasi Lecture04Kcd226 Sistem Operasi Lecture04
Kcd226 Sistem Operasi Lecture04Cahyo Darujati
 
OS Module-2.pptx
OS Module-2.pptxOS Module-2.pptx
OS Module-2.pptxbleh23
 
Chapter 02 modified
Chapter 02 modifiedChapter 02 modified
Chapter 02 modifiedJugal Doshi
 
Introduction to Operating System
Introduction to Operating SystemIntroduction to Operating System
Introduction to Operating SystemRashmi Bhat
 
Chapter 02
Chapter 02Chapter 02
Chapter 02 Google
 
”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016Kuniyasu Suzaki
 
Regarding About Operating System Structure
Regarding About Operating System StructureRegarding About Operating System Structure
Regarding About Operating System Structuresankarkvdc
 
Kcd226 Sistem Operasi Lecture06
Kcd226 Sistem Operasi Lecture06Kcd226 Sistem Operasi Lecture06
Kcd226 Sistem Operasi Lecture06Cahyo Darujati
 
Processes and Threads in Windows Vista
Processes and Threads in Windows VistaProcesses and Threads in Windows Vista
Processes and Threads in Windows VistaTrinh Phuc Tho
 
Erroneous co-routines can block system Formal interfaces slow down system
Erroneous co-routines can block system Formal  interfaces slow down systemErroneous co-routines can block system Formal  interfaces slow down system
Erroneous co-routines can block system Formal interfaces slow down systemjeronimored
 
Unix operating system
Unix operating systemUnix operating system
Unix operating systemABhay Panchal
 
Chromium os architecture report
Chromium os  architecture reportChromium os  architecture report
Chromium os architecture reportAmr Abd El Latief
 

Similar to Kcd226 Sistem Operasi Lecture03 (20)

Kcd226 Sistem Operasi Lecture02
Kcd226 Sistem Operasi Lecture02Kcd226 Sistem Operasi Lecture02
Kcd226 Sistem Operasi Lecture02
 
Kcd226 Sistem Operasi Lecture04
Kcd226 Sistem Operasi Lecture04Kcd226 Sistem Operasi Lecture04
Kcd226 Sistem Operasi Lecture04
 
OS Module-2.pptx
OS Module-2.pptxOS Module-2.pptx
OS Module-2.pptx
 
Chapter 02 modified
Chapter 02 modifiedChapter 02 modified
Chapter 02 modified
 
Chapter 6 os
Chapter 6 osChapter 6 os
Chapter 6 os
 
CH04.pdf
CH04.pdfCH04.pdf
CH04.pdf
 
Introduction to Operating System
Introduction to Operating SystemIntroduction to Operating System
Introduction to Operating System
 
Chapter 02
Chapter 02Chapter 02
Chapter 02
 
Chapter 02
Chapter 02Chapter 02
Chapter 02
 
”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016
 
Ch04 threads
Ch04 threadsCh04 threads
Ch04 threads
 
Regarding About Operating System Structure
Regarding About Operating System StructureRegarding About Operating System Structure
Regarding About Operating System Structure
 
OS Thr schd.ppt
OS Thr schd.pptOS Thr schd.ppt
OS Thr schd.ppt
 
Io sy.stemppt
Io sy.stempptIo sy.stemppt
Io sy.stemppt
 
Kcd226 Sistem Operasi Lecture06
Kcd226 Sistem Operasi Lecture06Kcd226 Sistem Operasi Lecture06
Kcd226 Sistem Operasi Lecture06
 
Processes and Threads in Windows Vista
Processes and Threads in Windows VistaProcesses and Threads in Windows Vista
Processes and Threads in Windows Vista
 
Erroneous co-routines can block system Formal interfaces slow down system
Erroneous co-routines can block system Formal  interfaces slow down systemErroneous co-routines can block system Formal  interfaces slow down system
Erroneous co-routines can block system Formal interfaces slow down system
 
Unix operating system
Unix operating systemUnix operating system
Unix operating system
 
Os
OsOs
Os
 
Chromium os architecture report
Chromium os  architecture reportChromium os  architecture report
Chromium os architecture report
 

More from Cahyo Darujati

Presentasi jaring pengaman sandi untuk mendukung spbe 29042019 rev2
Presentasi jaring pengaman sandi untuk mendukung spbe 29042019 rev2Presentasi jaring pengaman sandi untuk mendukung spbe 29042019 rev2
Presentasi jaring pengaman sandi untuk mendukung spbe 29042019 rev2Cahyo Darujati
 
Melindungi, Mengamankan, Menanggulangi, dan Memulihkan Keamanan Informasi Pen...
Melindungi, Mengamankan, Menanggulangi, dan Memulihkan Keamanan Informasi Pen...Melindungi, Mengamankan, Menanggulangi, dan Memulihkan Keamanan Informasi Pen...
Melindungi, Mengamankan, Menanggulangi, dan Memulihkan Keamanan Informasi Pen...Cahyo Darujati
 
Melawan penyebaran hoax di media sosial dengan teknologi
Melawan penyebaran hoax di media sosial dengan teknologiMelawan penyebaran hoax di media sosial dengan teknologi
Melawan penyebaran hoax di media sosial dengan teknologiCahyo Darujati
 
Security is a process not a magic
Security is a process not a magicSecurity is a process not a magic
Security is a process not a magicCahyo Darujati
 
01.welcome.ppt.sosialisasi.skkni.surabaya
01.welcome.ppt.sosialisasi.skkni.surabaya01.welcome.ppt.sosialisasi.skkni.surabaya
01.welcome.ppt.sosialisasi.skkni.surabayaCahyo Darujati
 
Mengatur referensi penelitian
Mengatur referensi penelitianMengatur referensi penelitian
Mengatur referensi penelitianCahyo Darujati
 
Tatakelola Teknologi Informasi
Tatakelola Teknologi InformasiTatakelola Teknologi Informasi
Tatakelola Teknologi InformasiCahyo Darujati
 
Kbk436 Sistem Operasi Lanjut Lecture02
Kbk436 Sistem Operasi Lanjut Lecture02Kbk436 Sistem Operasi Lanjut Lecture02
Kbk436 Sistem Operasi Lanjut Lecture02Cahyo Darujati
 
Kbk436 Sistem Operasi Lanjut Lecture01
Kbk436 Sistem Operasi Lanjut Lecture01Kbk436 Sistem Operasi Lanjut Lecture01
Kbk436 Sistem Operasi Lanjut Lecture01Cahyo Darujati
 
Kcd226 Sistem Operasi Lecture01
Kcd226 Sistem Operasi Lecture01Kcd226 Sistem Operasi Lecture01
Kcd226 Sistem Operasi Lecture01Cahyo Darujati
 
Kcd226 Sistem Operasi Lecture05
Kcd226 Sistem Operasi Lecture05Kcd226 Sistem Operasi Lecture05
Kcd226 Sistem Operasi Lecture05Cahyo Darujati
 
Kbk436 Sistem Operasi Lanjut Lecture01
Kbk436 Sistem Operasi Lanjut Lecture01Kbk436 Sistem Operasi Lanjut Lecture01
Kbk436 Sistem Operasi Lanjut Lecture01Cahyo Darujati
 
Kcd226 Sistem Operasi Lecture01
Kcd226 Sistem Operasi Lecture01Kcd226 Sistem Operasi Lecture01
Kcd226 Sistem Operasi Lecture01Cahyo Darujati
 

More from Cahyo Darujati (15)

Presentasi jaring pengaman sandi untuk mendukung spbe 29042019 rev2
Presentasi jaring pengaman sandi untuk mendukung spbe 29042019 rev2Presentasi jaring pengaman sandi untuk mendukung spbe 29042019 rev2
Presentasi jaring pengaman sandi untuk mendukung spbe 29042019 rev2
 
Melindungi, Mengamankan, Menanggulangi, dan Memulihkan Keamanan Informasi Pen...
Melindungi, Mengamankan, Menanggulangi, dan Memulihkan Keamanan Informasi Pen...Melindungi, Mengamankan, Menanggulangi, dan Memulihkan Keamanan Informasi Pen...
Melindungi, Mengamankan, Menanggulangi, dan Memulihkan Keamanan Informasi Pen...
 
Melawan penyebaran hoax di media sosial dengan teknologi
Melawan penyebaran hoax di media sosial dengan teknologiMelawan penyebaran hoax di media sosial dengan teknologi
Melawan penyebaran hoax di media sosial dengan teknologi
 
Security is a process not a magic
Security is a process not a magicSecurity is a process not a magic
Security is a process not a magic
 
01.welcome.ppt.sosialisasi.skkni.surabaya
01.welcome.ppt.sosialisasi.skkni.surabaya01.welcome.ppt.sosialisasi.skkni.surabaya
01.welcome.ppt.sosialisasi.skkni.surabaya
 
Mengatur referensi penelitian
Mengatur referensi penelitianMengatur referensi penelitian
Mengatur referensi penelitian
 
Tatakelola Teknologi Informasi
Tatakelola Teknologi InformasiTatakelola Teknologi Informasi
Tatakelola Teknologi Informasi
 
Pen test methodology
Pen test methodologyPen test methodology
Pen test methodology
 
pengenalan ipv6
pengenalan ipv6pengenalan ipv6
pengenalan ipv6
 
Kbk436 Sistem Operasi Lanjut Lecture02
Kbk436 Sistem Operasi Lanjut Lecture02Kbk436 Sistem Operasi Lanjut Lecture02
Kbk436 Sistem Operasi Lanjut Lecture02
 
Kbk436 Sistem Operasi Lanjut Lecture01
Kbk436 Sistem Operasi Lanjut Lecture01Kbk436 Sistem Operasi Lanjut Lecture01
Kbk436 Sistem Operasi Lanjut Lecture01
 
Kcd226 Sistem Operasi Lecture01
Kcd226 Sistem Operasi Lecture01Kcd226 Sistem Operasi Lecture01
Kcd226 Sistem Operasi Lecture01
 
Kcd226 Sistem Operasi Lecture05
Kcd226 Sistem Operasi Lecture05Kcd226 Sistem Operasi Lecture05
Kcd226 Sistem Operasi Lecture05
 
Kbk436 Sistem Operasi Lanjut Lecture01
Kbk436 Sistem Operasi Lanjut Lecture01Kbk436 Sistem Operasi Lanjut Lecture01
Kbk436 Sistem Operasi Lanjut Lecture01
 
Kcd226 Sistem Operasi Lecture01
Kcd226 Sistem Operasi Lecture01Kcd226 Sistem Operasi Lecture01
Kcd226 Sistem Operasi Lecture01
 

Recently uploaded

Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Developmentchesterberbo7
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptxJonalynLegaspi2
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 

Recently uploaded (20)

Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Development
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of EngineeringFaculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptx
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 

Kcd226 Sistem Operasi Lecture03

  • 1. Lecture 3 Processes and Threads 3.1. Processes 3.2. Threads Sistem Operasi http://fasilkom.narotama.ac.id/ 1
  • 2. Processes The Process Model • Multiprogramming of four programs • Conceptual model of 4 independent, sequential processes • Only one program active at any instant Sistem Operasi http://fasilkom.narotama.ac.id/ 2
  • 3. Process Creation Principal events that cause process creation 1. System initialization • Execution of a process creation system 1. User request to create a new process 2. Initiation of a batch job Sistem Operasi http://fasilkom.narotama.ac.id/ 3
  • 4. Process Termination Conditions which terminate processes 1. Normal exit (voluntary) 2. Error exit (voluntary) 3. Fatal error (involuntary) 4. Killed by another process (involuntary) Sistem Operasi http://fasilkom.narotama.ac.id/ 4
  • 5. Process Hierarchies • Parent creates a child process, child processes can create its own process • Forms a hierarchy – UNIX calls this a "process group" • Windows has no concept of process hierarchy – all processes are created equal Sistem Operasi http://fasilkom.narotama.ac.id/ 5
  • 6. Process States (1) • Possible process states – running – blocked – ready • Transitions between states shown Sistem Operasi http://fasilkom.narotama.ac.id/ 6
  • 7. Process States (2) • Lowest layer of process-structured OS – handles interrupts, scheduling • Above that layer are sequential processes Sistem Operasi http://fasilkom.narotama.ac.id/ 7
  • 8. Implementation of Processes (1) Sistem Operasi Fields of a process table entry http://fasilkom.narotama.ac.id/ 8
  • 9. Implementation of Processes (2) Skeleton of what lowest level of OS does when an interrupt occurs Sistem Operasi http://fasilkom.narotama.ac.id/ 9
  • 10. Threads The Thread Model (1) (a) Three processes each with one thread (b) Operasi process with three threads Sistem One http://fasilkom.narotama.ac.id/ 10
  • 11. The Thread Model (2) • Items shared by all threads in a process • Items private to each thread Sistem Operasi http://fasilkom.narotama.ac.id/ 11
  • 12. The Thread Model (3) Each thread has its own stack Sistem Operasi http://fasilkom.narotama.ac.id/ 12
  • 13. Thread Usage (1) A word processor with three threads Sistem Operasi http://fasilkom.narotama.ac.id/ 13
  • 14. Thread Usage (2) Sistem Operasi A multithreaded Web server http://fasilkom.narotama.ac.id/ 14
  • 15. Thread Usage (3) • Rough outline of code for previous slide (a) Dispatcher thread (b) Worker thread Sistem Operasi http://fasilkom.narotama.ac.id/ 15
  • 16. Thread Usage (4) Three ways to construct a server Sistem Operasi http://fasilkom.narotama.ac.id/ 16
  • 17. Implementing Threads in User Space A user-level threads package Sistem Operasi http://fasilkom.narotama.ac.id/ 17
  • 18. Implementing Threads in the Kernel A threads package managed by the kernel Sistem Operasi http://fasilkom.narotama.ac.id/ 18
  • 19. Hybrid Implementations Multiplexing user-level threads onto kernel- Sistem Operasi threads level http://fasilkom.narotama.ac.id/ 19
  • 20. Scheduler Activations • Goal – mimic functionality of kernel threads – gain performance of user space threads • Avoids unnecessary user/kernel transitions • Kernel assigns virtual processors to each process – lets runtime system allocate threads to processors • Problem: Fundamental reliance on kernel (lower layer) calling procedures in user space (higher layer) Sistem Operasi http://fasilkom.narotama.ac.id/ 20
  • 21. Pop-Up Threads • Creation of a new thread when message arrives (a) before message arrives (b) after messagehttp://fasilkom.narotama.ac.id/ Sistem Operasi arrives 21
  • 22. Making Single-Threaded Code Multithreaded (1) Conflicts between threads over the use of a global variable Sistem Operasi http://fasilkom.narotama.ac.id/ 22
  • 23. Making Single-Threaded Code Multithreaded (2) Threads can have private global variables Sistem Operasi http://fasilkom.narotama.ac.id/ 23
  • 24. Discussion / Question Sistem Operasi http://fasilkom.narotama.ac.id/ 24