SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinojohnmickonozaleda
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 

Kürzlich hochgeladen (20)

FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipino
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 

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