. ▁ ▁Over view ▁ ▁If ▁two ▁processes ▁attempt ▁to ▁enter ▁a ▁critical ▁section ▁at ▁the ▁same ▁time , ▁the ▁algorithm ▁will ▁allow ▁only ▁one ▁process ▁in , ▁based ▁on ▁whose ▁turn ▁it ▁is . ▁If ▁one ▁process ▁is ▁already ▁in ▁the ▁critical ▁section , ▁the ▁other ▁process ▁will ▁busy ▁wait ▁for ▁the ▁first ▁process ▁to ▁exit . ▁ ▁This ▁is ▁done ▁by ▁the ▁use ▁of ▁two ▁flags , ▁ ▁and ▁, ▁which ▁indicate ▁an ▁intention ▁to ▁enter ▁the ▁critical ▁section ▁on ▁the ▁part ▁of ▁processes ▁ 0 ▁and ▁ 1 , ▁respectively , ▁and ▁a ▁variable ▁ ▁that ▁indicates ▁who ▁has ▁priority ▁between ▁the ▁two ▁processes . ▁ ▁De k ker ' s ▁algorithm ▁can ▁be ▁expressed ▁in ▁pseudo code , ▁as ▁follows . ▁ ▁Process es ▁indicate ▁an ▁intention ▁to ▁enter ▁the ▁critical ▁section ▁which ▁is ▁tested ▁by ▁the ▁outer ▁while ▁loop . ▁ ▁If ▁the ▁other ▁process ▁has ▁not ▁flag ged ▁intent , ▁the ▁critical ▁section ▁can ▁be ▁entered ▁safely ▁ir res pective ▁of ▁the ▁current ▁turn . ▁ ▁Mut ual ▁ex clusion ▁will ▁still ▁be ▁guaranteed ▁as ▁neither ▁process ▁can ▁become ▁critical ▁before ▁setting ▁their ▁flag ▁( imp lying ▁at ▁least ▁one ▁process ▁will ▁enter ▁the ▁while ▁loop ). ▁ ▁This ▁also ▁guarante es ▁progress ▁as ▁waiting ▁will ▁not ▁occur ▁on ▁a ▁process ▁which ▁has ▁with dra wn ▁intent ▁to ▁become ▁critical . ▁ ▁Alternatively , ▁if ▁the ▁other ▁process ' s ▁variable ▁was ▁set ▁the ▁while ▁loop ▁is ▁entered ▁and ▁the ▁turn ▁variable ▁will ▁establish ▁who ▁is ▁permitted