SlideShare a Scribd company logo
Lecture 4
           Interprocess and Scheduling

                 4.1. Interprocess communication
                 4.2. Classical IPC problems
                 4.3. Scheduling




Sistem Operasi          http://fasilkom.narotama.ac.id/
                                                          1
Interprocess Communication
                   Race Conditions




Two processes want to access shared memory at same time
  Sistem Operasi    http://fasilkom.narotama.ac.id/
                                                          2
Critical Regions (1)

Four conditions to provide mutual exclusion
1.   No two processes simultaneously in critical region
2.   No assumptions made about speeds or numbers of CPUs
3.   No process running outside its critical region may block
     another process
4.   No process must wait forever to enter its critical region



     Sistem Operasi       http://fasilkom.narotama.ac.id/
                                                                 3
Critical Regions (2)




        Mutual exclusion using critical regions
Sistem Operasi       http://fasilkom.narotama.ac.id/
                                                       4
Mutual Exclusion with Busy Waiting (1)




  Proposed solution to critical region problem
     (a) Process 0.
Sistem Operasi
                           (b) Process 1.
                      http://fasilkom.narotama.ac.id/
                                                        5
Mutual Exclusion with Busy Waiting (2)




  Sistem Operasi   http://fasilkom.narotama.ac.id/
Peterson's solution for achieving mutual exclusion   6
Mutual Exclusion with Busy Waiting (3)




Entering and leaving a critical region using the
Sistem Operasi TSL instruction
                http://fasilkom.narotama.ac.id/
                                                   7
Sleep and Wakeup




Producer-consumer http://fasilkom.narotama.ac.id/ fatal race condition8
   Sistem Operasi
                  problem with
Semaphores




TheSistem Operasi http://fasilkom.narotama.ac.id/
    producer-consumer problem using semaphores      9
Mutexes




Implementation of mutex_lock and mutex_unlock
 Sistem Operasi   http://fasilkom.narotama.ac.id/
                                                    10
Monitors (1)




Sistem Operasi   Example of a monitor
                    http://fasilkom.narotama.ac.id/
                                                      11
Monitors (2)




• Outline of producer-consumer problem with monitors
  – only one monitor procedure active at one time
  Sistem Operasi           http://fasilkom.narotama.ac.id/
  – buffer has N slots                                       12
Monitors (3)




Solution to producer-consumer problem in Java (part 1)
 Sistem Operasi    http://fasilkom.narotama.ac.id/
                                                         13
Monitors (4)




Solution to producer-consumer problem in Java (part 2)
Sistem Operasi    http://fasilkom.narotama.ac.id/
                                                         14
Message Passing




The producer-consumer problem with N messages
 Sistem Operasi  http://fasilkom.narotama.ac.id/
                                                   15
Barriers




• Use of a barrier
      – processes approaching a barrier
      – all processes but one blocked at barrier
Sistem Operasi         http://fasilkom.narotama.ac.id/
      – last process arrives, all are let through        16
Dining Philosophers (1)


•   Philosophers eat/think
•   Eating needs 2 forks
•   Pick one fork at a time
•   How to prevent deadlock




    Sistem Operasi         http://fasilkom.narotama.ac.id/
                                                             17
Dining Philosophers (2)




A nonsolution to the dining philosophers problem
 Sistem Operasi         http://fasilkom.narotama.ac.id/
                                                          18
Dining Philosophers (3)




Sistem Operasi         http://fasilkom.narotama.ac.id/
Solution to dining philosophers problem (part 1)         19
Dining Philosophers (4)




Sistem Operasi      http://fasilkom.narotama.ac.id/
Solution to dining philosophers problem (part 2)      20
The Readers and Writers Problem




 A solution to the readers and writers problem
Sistem Operasi   http://fasilkom.narotama.ac.id/
                                                   21
The Sleeping Barber Problem (1)




Sistem Operasi   http://fasilkom.narotama.ac.id/
                                                   22
The Sleeping Barber Problem (2)




Sistem Operasi    http://fasilkom.narotama.ac.id/
                 Solution to sleeping barber problem.   23
Scheduling
                   Introduction to Scheduling (1)




• Bursts of CPU usage alternate with periods of I/O wait
   – a CPU-bound process
   – an I/O bound process
  Sistem Operasi           http://fasilkom.narotama.ac.id/
                                                             24
Introduction to Scheduling (2)




Sistem Operasi   Scheduling Algorithm Goals
                        http://fasilkom.narotama.ac.id/
                                                          25
Scheduling in Batch Systems (1)




   An example of shortest job first scheduling
Sistem Operasi   http://fasilkom.narotama.ac.id/
                                                   26
Scheduling in Batch Systems (2)




Sistem Operasi   Three level scheduling
                     http://fasilkom.narotama.ac.id/
                                                       27
Scheduling in Interactive Systems (1)




• Round Robin Scheduling
  – list of runnable processes
  – list of runnable processes after B uses up its quantum
  Sistem Operasi      http://fasilkom.narotama.ac.id/
                                                             28
Scheduling in Interactive Systems (2)




A scheduling algorithm with four priority classes
 Sistem Operasi   http://fasilkom.narotama.ac.id/
                                                    29
Scheduling in Real-Time Systems


Schedulable real-time system
• Given
     – m periodic events
     – event i occurs within period Pi and requires Ci
       seconds
• Then the load can only be handled if
                        m
                          Ci
                     ∑ P ≤1
                     i =1
Sistem Operasi             i
                     http://fasilkom.narotama.ac.id/
                                                         30
Policy versus Mechanism

• Separate what is allowed to be done with
  how it is done
      – a process knows which of its children threads
        are important and need priority

• Scheduling algorithm parameterized
      – mechanism in the kernel

• Parameters filled in by user processes
      – policy set by user process
Sistem Operasi       http://fasilkom.narotama.ac.id/
                                                        31
Thread Scheduling (1)




      Possible scheduling of user-level threads
        • 50-msec process quantum
        • threads run http://fasilkom.narotama.ac.id/
Sistem Operasi
                      5 msec/CPU burst                  32
Thread Scheduling (2)




      Possible scheduling of kernel-level threads
        • 50-msec process quantum
        • threads run http://fasilkom.narotama.ac.id/
Sistem Operasi        5 msec/CPU burst
                                                        33
Question ?




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

More Related Content

What's hot

Chapter 02 modified
Chapter 02 modifiedChapter 02 modified
Chapter 02 modifiedJugal Doshi
 
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERSVTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
vtunotesbysree
 
Windows process scheduling presentation
Windows process scheduling presentationWindows process scheduling presentation
Windows process scheduling presentation
Talha Shaikh
 
2009 Punjab Technical University B.C.A OPERATING SYSTEM Question paper
2009 Punjab Technical University B.C.A OPERATING SYSTEM Question paper2009 Punjab Technical University B.C.A OPERATING SYSTEM Question paper
2009 Punjab Technical University B.C.A OPERATING SYSTEM Question paperMonica Sabharwal
 
Real time-embedded-system-lec-02
Real time-embedded-system-lec-02Real time-embedded-system-lec-02
Real time-embedded-system-lec-02
University of Computer Science and Technology
 
Os Question Bank
Os Question BankOs Question Bank
Os Question Bank
Sonali Chauhan
 
Rtos Concepts
Rtos ConceptsRtos Concepts
Rtos Concepts
Sundaresan Sundar
 
3 process management
3 process management3 process management
3 process management
Dr. Loganathan R
 
process management
 process management process management
process managementAshish Kumar
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating SystemsRohit Joshi
 
Operating Systems Part II-Process Scheduling, Synchronisation & Deadlock
Operating Systems Part II-Process Scheduling, Synchronisation & DeadlockOperating Systems Part II-Process Scheduling, Synchronisation & Deadlock
Operating Systems Part II-Process Scheduling, Synchronisation & Deadlock
Ajit Nayak
 
Operating system - Process and its concepts
Operating system - Process and its conceptsOperating system - Process and its concepts
Operating system - Process and its concepts
Karan Thakkar
 
Chapter 19 - Real Time Systems
Chapter 19 - Real Time SystemsChapter 19 - Real Time Systems
Chapter 19 - Real Time Systems
Wayne Jones Jnr
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
Ashwani Garg
 
OS Process and Thread Concepts
OS Process and Thread ConceptsOS Process and Thread Concepts
OS Process and Thread Concepts
sgpraju
 
Os notes
Os notesOs notes
Os notes
LakshmiSarvani6
 
Processes and operating systems
Processes and operating systemsProcesses and operating systems
Processes and operating systems
RAMPRAKASHT1
 

What's hot (20)

Chapter 02 modified
Chapter 02 modifiedChapter 02 modified
Chapter 02 modified
 
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERSVTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
 
Windows process scheduling presentation
Windows process scheduling presentationWindows process scheduling presentation
Windows process scheduling presentation
 
2009 Punjab Technical University B.C.A OPERATING SYSTEM Question paper
2009 Punjab Technical University B.C.A OPERATING SYSTEM Question paper2009 Punjab Technical University B.C.A OPERATING SYSTEM Question paper
2009 Punjab Technical University B.C.A OPERATING SYSTEM Question paper
 
Os2
Os2Os2
Os2
 
Real time-embedded-system-lec-02
Real time-embedded-system-lec-02Real time-embedded-system-lec-02
Real time-embedded-system-lec-02
 
Os Question Bank
Os Question BankOs Question Bank
Os Question Bank
 
Rtos Concepts
Rtos ConceptsRtos Concepts
Rtos Concepts
 
Rtos part2
Rtos part2Rtos part2
Rtos part2
 
3 process management
3 process management3 process management
3 process management
 
Lecture 5 process concept
Lecture 5   process conceptLecture 5   process concept
Lecture 5 process concept
 
process management
 process management process management
process management
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
 
Operating Systems Part II-Process Scheduling, Synchronisation & Deadlock
Operating Systems Part II-Process Scheduling, Synchronisation & DeadlockOperating Systems Part II-Process Scheduling, Synchronisation & Deadlock
Operating Systems Part II-Process Scheduling, Synchronisation & Deadlock
 
Operating system - Process and its concepts
Operating system - Process and its conceptsOperating system - Process and its concepts
Operating system - Process and its concepts
 
Chapter 19 - Real Time Systems
Chapter 19 - Real Time SystemsChapter 19 - Real Time Systems
Chapter 19 - Real Time Systems
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
 
OS Process and Thread Concepts
OS Process and Thread ConceptsOS Process and Thread Concepts
OS Process and Thread Concepts
 
Os notes
Os notesOs notes
Os notes
 
Processes and operating systems
Processes and operating systemsProcesses and operating systems
Processes and operating systems
 

Viewers also liked

Chapter9
Chapter9Chapter9
Chapter9
kathiroli
 
1. review jurnal effect dwi hastho
1. review jurnal effect dwi hastho1. review jurnal effect dwi hastho
1. review jurnal effect dwi hastho
Hastho Oke Sekali Jaya
 
Op Sy 03 Ch 23
Op Sy 03 Ch 23Op Sy 03 Ch 23
Op Sy 03 Ch 23 Google
 
Kcd226 Sistem Operasi Lecture06
Kcd226 Sistem Operasi Lecture06Kcd226 Sistem Operasi Lecture06
Kcd226 Sistem Operasi Lecture06Cahyo Darujati
 
2. review jurnal barrier dwi hastho
2. review jurnal barrier dwi hastho2. review jurnal barrier dwi hastho
2. review jurnal barrier dwi hastho
Hastho Oke Sekali Jaya
 
Ch4: Processes (OS)
Ch4: Processes (OS)Ch4: Processes (OS)
Ch4: Processes (OS)
Ahmar Hashmi
 
Chapter 3 - Processes
Chapter 3 - ProcessesChapter 3 - Processes
Chapter 3 - Processes
Wayne Jones Jnr
 
Guide
GuideGuide
My SQl
My SQlMy SQl
My SQl
Ramasubbu .P
 
IP Addressing
IP AddressingIP Addressing
IP Addressing
Ramasubbu .P
 
Saftey
SafteySaftey
Saftey
Ramasubbu .P
 
I/O Management
I/O ManagementI/O Management
I/O Management
Ramasubbu .P
 
Shell Script
Shell ScriptShell Script
Shell Script
Ramasubbu .P
 
Interprocess Communication
Interprocess CommunicationInterprocess Communication
Interprocess Communication
Deepak H L
 
Network Security
Network SecurityNetwork Security
Network Security
Ramasubbu .P
 
Operating systems
Operating systemsOperating systems
Operating systems
Eduardo Triana
 

Viewers also liked (20)

Chapter9
Chapter9Chapter9
Chapter9
 
1. review jurnal effect dwi hastho
1. review jurnal effect dwi hastho1. review jurnal effect dwi hastho
1. review jurnal effect dwi hastho
 
Ipc ppt
Ipc pptIpc ppt
Ipc ppt
 
Op Sy 03 Ch 23
Op Sy 03 Ch 23Op Sy 03 Ch 23
Op Sy 03 Ch 23
 
Kcd226 Sistem Operasi Lecture06
Kcd226 Sistem Operasi Lecture06Kcd226 Sistem Operasi Lecture06
Kcd226 Sistem Operasi Lecture06
 
IPC
IPCIPC
IPC
 
2. review jurnal barrier dwi hastho
2. review jurnal barrier dwi hastho2. review jurnal barrier dwi hastho
2. review jurnal barrier dwi hastho
 
Ch4: Processes (OS)
Ch4: Processes (OS)Ch4: Processes (OS)
Ch4: Processes (OS)
 
Chapter 3 - Processes
Chapter 3 - ProcessesChapter 3 - Processes
Chapter 3 - Processes
 
Guide
GuideGuide
Guide
 
sql
sqlsql
sql
 
My SQl
My SQlMy SQl
My SQl
 
IP Addressing
IP AddressingIP Addressing
IP Addressing
 
Saftey
SafteySaftey
Saftey
 
Mysql
MysqlMysql
Mysql
 
I/O Management
I/O ManagementI/O Management
I/O Management
 
Shell Script
Shell ScriptShell Script
Shell Script
 
Interprocess Communication
Interprocess CommunicationInterprocess Communication
Interprocess Communication
 
Network Security
Network SecurityNetwork Security
Network Security
 
Operating systems
Operating systemsOperating systems
Operating systems
 

Similar to Kcd226 Sistem Operasi Lecture04

Kcd226 Sistem Operasi Lecture03
Kcd226 Sistem Operasi Lecture03Kcd226 Sistem Operasi Lecture03
Kcd226 Sistem Operasi Lecture03Cahyo Darujati
 
Kcd226 Sistem Operasi Lecture02
Kcd226 Sistem Operasi Lecture02Kcd226 Sistem Operasi Lecture02
Kcd226 Sistem Operasi Lecture02Cahyo Darujati
 
Kcd226 Sistem Operasi Lecture05
Kcd226 Sistem Operasi Lecture05Kcd226 Sistem Operasi Lecture05
Kcd226 Sistem Operasi Lecture05Cahyo Darujati
 
OPERATING SYSTEM CHAPTER 3.ppt
OPERATING SYSTEM CHAPTER 3.pptOPERATING SYSTEM CHAPTER 3.ppt
OPERATING SYSTEM CHAPTER 3.ppt
GevitaChinnaiah
 
procress and threads.ppt
procress and threads.pptprocress and threads.ppt
procress and threads.ppt
DrBashirMSaad
 
Processes and Threads in modern Operating system
Processes and Threads in modern Operating systemProcesses and Threads in modern Operating system
Processes and Threads in modern Operating system
ssuserf2075d
 
Process and Thread
Process and Thread Process and Thread
Process and Thread
Poornima E.G.
 
OS_MD_1.pdf
OS_MD_1.pdfOS_MD_1.pdf
OS_MD_1.pdf
GauravDagar13
 
Kbk436 Sistem Operasi Lanjut Lecture01
Kbk436 Sistem Operasi Lanjut Lecture01Kbk436 Sistem Operasi Lanjut Lecture01
Kbk436 Sistem Operasi Lanjut Lecture01Cahyo Darujati
 
Intro720T5.pptx
Intro720T5.pptxIntro720T5.pptx
Intro720T5.pptx
MahendraShukla27
 
Embedded systems notes
Embedded systems notesEmbedded systems notes
Embedded systems notes
Shikha Sharma
 
Operating System-Ch2 computer system structures
Operating System-Ch2 computer system structuresOperating System-Ch2 computer system structures
Operating System-Ch2 computer system structures
Syaiful Ahdan
 
04 threads-pbl-2-slots
04 threads-pbl-2-slots04 threads-pbl-2-slots
04 threads-pbl-2-slots
mha4
 
04 threads-pbl-2-slots
04 threads-pbl-2-slots04 threads-pbl-2-slots
04 threads-pbl-2-slots
mha4
 
IT241 - Full Summary.pdf
IT241 - Full Summary.pdfIT241 - Full Summary.pdf
IT241 - Full Summary.pdf
SHEHABALYAMANI
 
Ch2.1 computer system structures
Ch2.1 computer system structures Ch2.1 computer system structures
Ch2.1 computer system structures
Syaiful Ahdan
 
Processes and Thread OS_Tanenbaum_3e
Processes and Thread OS_Tanenbaum_3eProcesses and Thread OS_Tanenbaum_3e
Processes and Thread OS_Tanenbaum_3e
Le Gia Hoang
 
EC 308 Embedded Systems Module 1 Notes APJKTU
EC 308 Embedded Systems Module 1 Notes APJKTUEC 308 Embedded Systems Module 1 Notes APJKTU
EC 308 Embedded Systems Module 1 Notes APJKTU
Agi George
 
Operating System Notes (1).pdf
Operating System Notes (1).pdfOperating System Notes (1).pdf
Operating System Notes (1).pdf
shriyashpatil7
 
Operating System Notes help for interview pripration
Operating System Notes  help for interview priprationOperating System Notes  help for interview pripration
Operating System Notes help for interview pripration
ajaybiradar99999
 

Similar to Kcd226 Sistem Operasi Lecture04 (20)

Kcd226 Sistem Operasi Lecture03
Kcd226 Sistem Operasi Lecture03Kcd226 Sistem Operasi Lecture03
Kcd226 Sistem Operasi Lecture03
 
Kcd226 Sistem Operasi Lecture02
Kcd226 Sistem Operasi Lecture02Kcd226 Sistem Operasi Lecture02
Kcd226 Sistem Operasi Lecture02
 
Kcd226 Sistem Operasi Lecture05
Kcd226 Sistem Operasi Lecture05Kcd226 Sistem Operasi Lecture05
Kcd226 Sistem Operasi Lecture05
 
OPERATING SYSTEM CHAPTER 3.ppt
OPERATING SYSTEM CHAPTER 3.pptOPERATING SYSTEM CHAPTER 3.ppt
OPERATING SYSTEM CHAPTER 3.ppt
 
procress and threads.ppt
procress and threads.pptprocress and threads.ppt
procress and threads.ppt
 
Processes and Threads in modern Operating system
Processes and Threads in modern Operating systemProcesses and Threads in modern Operating system
Processes and Threads in modern Operating system
 
Process and Thread
Process and Thread Process and Thread
Process and Thread
 
OS_MD_1.pdf
OS_MD_1.pdfOS_MD_1.pdf
OS_MD_1.pdf
 
Kbk436 Sistem Operasi Lanjut Lecture01
Kbk436 Sistem Operasi Lanjut Lecture01Kbk436 Sistem Operasi Lanjut Lecture01
Kbk436 Sistem Operasi Lanjut Lecture01
 
Intro720T5.pptx
Intro720T5.pptxIntro720T5.pptx
Intro720T5.pptx
 
Embedded systems notes
Embedded systems notesEmbedded systems notes
Embedded systems notes
 
Operating System-Ch2 computer system structures
Operating System-Ch2 computer system structuresOperating System-Ch2 computer system structures
Operating System-Ch2 computer system structures
 
04 threads-pbl-2-slots
04 threads-pbl-2-slots04 threads-pbl-2-slots
04 threads-pbl-2-slots
 
04 threads-pbl-2-slots
04 threads-pbl-2-slots04 threads-pbl-2-slots
04 threads-pbl-2-slots
 
IT241 - Full Summary.pdf
IT241 - Full Summary.pdfIT241 - Full Summary.pdf
IT241 - Full Summary.pdf
 
Ch2.1 computer system structures
Ch2.1 computer system structures Ch2.1 computer system structures
Ch2.1 computer system structures
 
Processes and Thread OS_Tanenbaum_3e
Processes and Thread OS_Tanenbaum_3eProcesses and Thread OS_Tanenbaum_3e
Processes and Thread OS_Tanenbaum_3e
 
EC 308 Embedded Systems Module 1 Notes APJKTU
EC 308 Embedded Systems Module 1 Notes APJKTUEC 308 Embedded Systems Module 1 Notes APJKTU
EC 308 Embedded Systems Module 1 Notes APJKTU
 
Operating System Notes (1).pdf
Operating System Notes (1).pdfOperating System Notes (1).pdf
Operating System Notes (1).pdf
 
Operating System Notes help for interview pripration
Operating System Notes  help for interview priprationOperating System Notes  help for interview pripration
Operating System Notes help for interview pripration
 

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 rev2
Cahyo 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 teknologi
Cahyo 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 magic
Cahyo 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 penelitian
Cahyo Darujati
 
Tatakelola Teknologi Informasi
Tatakelola Teknologi InformasiTatakelola Teknologi Informasi
Tatakelola Teknologi Informasi
Cahyo Darujati
 
Pen test methodology
Pen test methodologyPen test methodology
Pen test methodology
Cahyo Darujati
 
pengenalan ipv6
pengenalan ipv6pengenalan ipv6
pengenalan ipv6
Cahyo Darujati
 
Kbk436 Sistem Operasi Lanjut Lecture02
Kbk436 Sistem Operasi Lanjut Lecture02Kbk436 Sistem Operasi Lanjut Lecture02
Kbk436 Sistem Operasi Lanjut Lecture02Cahyo Darujati
 
Kcd226 Sistem Operasi Lecture01
Kcd226 Sistem Operasi Lecture01Kcd226 Sistem Operasi Lecture01
Kcd226 Sistem Operasi Lecture01Cahyo Darujati
 
Kbk436 Sistem Operasi Lanjut Lecture01
Kbk436 Sistem Operasi Lanjut Lecture01Kbk436 Sistem Operasi Lanjut Lecture01
Kbk436 Sistem Operasi Lanjut Lecture01
Cahyo Darujati
 
Kcd226 Sistem Operasi Lecture01
Kcd226 Sistem Operasi Lecture01Kcd226 Sistem Operasi Lecture01
Kcd226 Sistem Operasi Lecture01
Cahyo Darujati
 

More from Cahyo Darujati (13)

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
 
Kcd226 Sistem Operasi Lecture01
Kcd226 Sistem Operasi Lecture01Kcd226 Sistem Operasi Lecture01
Kcd226 Sistem Operasi Lecture01
 
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

"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
DhatriParmar
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 

Recently uploaded (20)

"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 

Kcd226 Sistem Operasi Lecture04

  • 1. Lecture 4 Interprocess and Scheduling 4.1. Interprocess communication 4.2. Classical IPC problems 4.3. Scheduling Sistem Operasi http://fasilkom.narotama.ac.id/ 1
  • 2. Interprocess Communication Race Conditions Two processes want to access shared memory at same time Sistem Operasi http://fasilkom.narotama.ac.id/ 2
  • 3. Critical Regions (1) Four conditions to provide mutual exclusion 1. No two processes simultaneously in critical region 2. No assumptions made about speeds or numbers of CPUs 3. No process running outside its critical region may block another process 4. No process must wait forever to enter its critical region Sistem Operasi http://fasilkom.narotama.ac.id/ 3
  • 4. Critical Regions (2) Mutual exclusion using critical regions Sistem Operasi http://fasilkom.narotama.ac.id/ 4
  • 5. Mutual Exclusion with Busy Waiting (1) Proposed solution to critical region problem (a) Process 0. Sistem Operasi (b) Process 1. http://fasilkom.narotama.ac.id/ 5
  • 6. Mutual Exclusion with Busy Waiting (2) Sistem Operasi http://fasilkom.narotama.ac.id/ Peterson's solution for achieving mutual exclusion 6
  • 7. Mutual Exclusion with Busy Waiting (3) Entering and leaving a critical region using the Sistem Operasi TSL instruction http://fasilkom.narotama.ac.id/ 7
  • 8. Sleep and Wakeup Producer-consumer http://fasilkom.narotama.ac.id/ fatal race condition8 Sistem Operasi problem with
  • 9. Semaphores TheSistem Operasi http://fasilkom.narotama.ac.id/ producer-consumer problem using semaphores 9
  • 10. Mutexes Implementation of mutex_lock and mutex_unlock Sistem Operasi http://fasilkom.narotama.ac.id/ 10
  • 11. Monitors (1) Sistem Operasi Example of a monitor http://fasilkom.narotama.ac.id/ 11
  • 12. Monitors (2) • Outline of producer-consumer problem with monitors – only one monitor procedure active at one time Sistem Operasi http://fasilkom.narotama.ac.id/ – buffer has N slots 12
  • 13. Monitors (3) Solution to producer-consumer problem in Java (part 1) Sistem Operasi http://fasilkom.narotama.ac.id/ 13
  • 14. Monitors (4) Solution to producer-consumer problem in Java (part 2) Sistem Operasi http://fasilkom.narotama.ac.id/ 14
  • 15. Message Passing The producer-consumer problem with N messages Sistem Operasi http://fasilkom.narotama.ac.id/ 15
  • 16. Barriers • Use of a barrier – processes approaching a barrier – all processes but one blocked at barrier Sistem Operasi http://fasilkom.narotama.ac.id/ – last process arrives, all are let through 16
  • 17. Dining Philosophers (1) • Philosophers eat/think • Eating needs 2 forks • Pick one fork at a time • How to prevent deadlock Sistem Operasi http://fasilkom.narotama.ac.id/ 17
  • 18. Dining Philosophers (2) A nonsolution to the dining philosophers problem Sistem Operasi http://fasilkom.narotama.ac.id/ 18
  • 19. Dining Philosophers (3) Sistem Operasi http://fasilkom.narotama.ac.id/ Solution to dining philosophers problem (part 1) 19
  • 20. Dining Philosophers (4) Sistem Operasi http://fasilkom.narotama.ac.id/ Solution to dining philosophers problem (part 2) 20
  • 21. The Readers and Writers Problem A solution to the readers and writers problem Sistem Operasi http://fasilkom.narotama.ac.id/ 21
  • 22. The Sleeping Barber Problem (1) Sistem Operasi http://fasilkom.narotama.ac.id/ 22
  • 23. The Sleeping Barber Problem (2) Sistem Operasi http://fasilkom.narotama.ac.id/ Solution to sleeping barber problem. 23
  • 24. Scheduling Introduction to Scheduling (1) • Bursts of CPU usage alternate with periods of I/O wait – a CPU-bound process – an I/O bound process Sistem Operasi http://fasilkom.narotama.ac.id/ 24
  • 25. Introduction to Scheduling (2) Sistem Operasi Scheduling Algorithm Goals http://fasilkom.narotama.ac.id/ 25
  • 26. Scheduling in Batch Systems (1) An example of shortest job first scheduling Sistem Operasi http://fasilkom.narotama.ac.id/ 26
  • 27. Scheduling in Batch Systems (2) Sistem Operasi Three level scheduling http://fasilkom.narotama.ac.id/ 27
  • 28. Scheduling in Interactive Systems (1) • Round Robin Scheduling – list of runnable processes – list of runnable processes after B uses up its quantum Sistem Operasi http://fasilkom.narotama.ac.id/ 28
  • 29. Scheduling in Interactive Systems (2) A scheduling algorithm with four priority classes Sistem Operasi http://fasilkom.narotama.ac.id/ 29
  • 30. Scheduling in Real-Time Systems Schedulable real-time system • Given – m periodic events – event i occurs within period Pi and requires Ci seconds • Then the load can only be handled if m Ci ∑ P ≤1 i =1 Sistem Operasi i http://fasilkom.narotama.ac.id/ 30
  • 31. Policy versus Mechanism • Separate what is allowed to be done with how it is done – a process knows which of its children threads are important and need priority • Scheduling algorithm parameterized – mechanism in the kernel • Parameters filled in by user processes – policy set by user process Sistem Operasi http://fasilkom.narotama.ac.id/ 31
  • 32. Thread Scheduling (1) Possible scheduling of user-level threads • 50-msec process quantum • threads run http://fasilkom.narotama.ac.id/ Sistem Operasi 5 msec/CPU burst 32
  • 33. Thread Scheduling (2) Possible scheduling of kernel-level threads • 50-msec process quantum • threads run http://fasilkom.narotama.ac.id/ Sistem Operasi 5 msec/CPU burst 33
  • 34. Question ? Sistem Operasi http://fasilkom.narotama.ac.id/ 34