# Mutual Exclusion with Variable Lock Method

Mutual Exclusion with Variable Lock method is a mechanism used to ensure that only one process can access the critical section at a time. It works by assigning a lock variable to the critical

• Uploaded on | 0 Views
• jessie

## About Mutual Exclusion with Variable Lock Method

PowerPoint presentation about 'Mutual Exclusion with Variable Lock Method'. This presentation describes the topic on Mutual Exclusion with Variable Lock method is a mechanism used to ensure that only one process can access the critical section at a time. It works by assigning a lock variable to the critical. The key topics included in this slideshow are . Download this presentation absolutely free.

## Presentation Transcript

Slide1Mutual Exclution Mutual  Exclution Dosen: Jajang Kusnendar, M.T Metode  Variable Lock

Slide2Variable Lock Variable  Lock • Sebuah Mekanisme untuk menjamin  Mutual Exclution • Setiap proses yang akan memasuki  Critical Section harus melakukan pengecekan terhadap nilai  lock variable . > Jika 0 , berarti proses dapat memasuki  Critical Section >  Jika 1 , maka proses harus menunggu sampai  lock variable  = 0

Slide3Variable Lock(1) Variable  Lock(1) Kelemahan/Kesalahan : 2 buah proses dapat memasuki critical section pada saat yang bersamaan Hal ini disebut dengan  Race Condition

Slide4Simulasi Variable  Lock Simulasi  Variable  Lock PLAY

Slide5Lock = 1Lock = 0 P2 P2 P3 P3 Cek OK ! Masuk Critical Section CRITICAL SECTION P1 P1

Slide6Lock = 0Lock = 1 Lock = 0 P3 P3 CRITICAL SECTION P1 P1 wait OK ! Masuk Critical Section P2 P2