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

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 

Recently uploaded (20)

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 

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