{"id":6290,"date":"2025-10-07T11:10:13","date_gmt":"2025-10-07T05:40:13","guid":{"rendered":"https:\/\/study.madeeasy.in\/?p=6290"},"modified":"2025-10-07T11:10:13","modified_gmt":"2025-10-07T05:40:13","slug":"two-process-software","status":"publish","type":"post","link":"https:\/\/www.madeeasy.in\/study\/cs-it\/operating-system\/two-process-software","title":{"rendered":"Two Process Software Solution in OS Synchronization"},"content":{"rendered":"<p><strong> Lock variable<\/strong><br \/>\n<strong>Entry section<\/strong><\/p>\n<p>I Load Ri, m[lock]<br \/>\nII. Comp Ri , #0<br \/>\nIII. JNZ to step IIV.<br \/>\nIVStore m[lock], #1<br \/>\nV. Critical section (CS)<br \/>\nVI. Store m[lock], #0<\/p>\n<p><strong>Analysis<\/strong><\/p>\n<p>Initially lock = 0<br \/>\nLet P1 arrives<br \/>\nP1 \u2192 I<br \/>\nP1 \u2192 II R1 0<\/p>\n<p>P1 \u2192 III<br \/>\nLet after this P1 preempts and P2 comes<br \/>\nP2 \u2192 I<br \/>\nP2 \u2192 II R2 0<\/p>\n<p>P2 \u2192 III<br \/>\nP2 \u2192 IV \u2192 lock = 0 1<img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-6291 alignright\" src=\"https:\/\/study.madeeasy.in\/wp-content\/uploads\/2025\/10\/lock-variable.jpg\" alt=\" Lock variable\n\" width=\"133\" height=\"106\" \/>P2 \u2192 V \u2192 P2 enters CS<br \/>\nAgain suppose P2 gets preempted<br \/>\nP1 \u2192 IV \u2192 lock = 0 1 1<br \/>\nP1 also enters CS.<br \/>\nMutual exclusion is not satisfied.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lock variable Entry section I Load Ri, m[lock] II. Comp Ri , #0 III. JNZ to step IIV. IVStore m[lock],<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[94,3],"tags":[1859,1857,1858],"class_list":["post-6290","post","type-post","status-publish","format-standard","hentry","category-operating-system","category-cs-it","tag-lock-variable","tag-mutual-exclusion","tag-process-synchronization"],"_links":{"self":[{"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/posts\/6290","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/comments?post=6290"}],"version-history":[{"count":0,"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/posts\/6290\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/media?parent=6290"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/categories?post=6290"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/tags?post=6290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}