{"id":269,"date":"2019-09-04T15:49:27","date_gmt":"2019-09-04T10:19:27","guid":{"rendered":"https:\/\/binaryterms.com\/?p=269"},"modified":"2021-02-10T14:13:38","modified_gmt":"2021-02-10T08:43:38","slug":"critical-section-problem","status":"publish","type":"post","link":"https:\/\/binaryterms.com\/critical-section-problem.html","title":{"rendered":"Critical Section Problem"},"content":{"rendered":"<p>The part of the process, where the code for accessing the shared resources is written, that part or section is the <strong>critical section (CS)<\/strong> of that process. Now the <strong>critical section problem<\/strong> is to implement such a solution, which can be used by the processes to cooperate when they share common resources.<\/p>\n<p>To execute its critical section, a process must take care of the three properties <strong>mutual exclusion, progress and bounded wait<\/strong>. Possessing these three properties a process can execute its critical section successfully. In this section, we will discuss the definition of the critical section, properties important for implementing critical section, a solution to implement critical section.<\/p>\n<h2>Content: Critical Section (CS) Problem<\/h2>\n<ol>\n<li><a href=\"#Definition\">Definition<\/a><\/li>\n<li><a href=\"#PropertiestoImplementCriticalSection\">Properties to Implement Critical Section<\/a><\/li>\n<li><a href=\"#SolutiontoImplementCriticalSection\">Solution to Implement Critical Section<\/a><\/li>\n<li><a href=\"#KeyTakeaways\">Key Takeaways<\/a><\/li>\n<\/ol>\n<h2><a name=\"Definition\"><\/a><br \/>\nDefinition<\/h2>\n<p>We know that there are multiple processes in the system and these processes access shared resources. When these processes access the shared resources simultaneously then the results obtained are <strong>inconsistent<\/strong>.<\/p>\n<p>To avoid such inconsistency in the result the processes must cooperate while accessing the shared resources. Therefore, the code to access shared resources is written under the <strong>critical section<\/strong> of the process. Let us understand the inconsistency in the result while accessing the shared resource simultaneously with the help of an example.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-273\" src=\"https:\/\/binaryterms.com\/wp-content\/uploads\/2019\/09\/Race-Condition.jpg\" alt=\"Race Condition\" width=\"399\" height=\"221\" srcset=\"https:\/\/binaryterms.com\/wp-content\/uploads\/2019\/09\/Race-Condition.jpg 399w, https:\/\/binaryterms.com\/wp-content\/uploads\/2019\/09\/Race-Condition-300x166.jpg 300w\" sizes=\"auto, (max-width: 399px) 100vw, 399px\" \/><\/p>\n<p>Look at the figure above, suppose there are two processes P0 and P1. Both share a common variable A=0. While accessing A both the processes increments the value of A by 1.<\/p>\n<p><span style=\"text-decoration: underline\"><strong>First case<\/strong><\/span><\/p>\n<p>The order of execution of the processes is P0, P1 respectively.<\/p>\n<p>Process P0 reads the value of A=0, increments it by 1 (A=1) and writes the incremented value in A.<\/p>\n<p>Now, process P1 reads the value of A =1, increments its value by 1 (A=2) and writes the incremented value in A.<\/p>\n<p>So, after both the processes P0 &amp; P1 finishes accessing the variable A. The value of A is 2.<\/p>\n<p><span style=\"text-decoration: underline\"><strong>Second case<\/strong><\/span><\/p>\n<p>Consider that process P0 has read the variable A=0. Suddenly context switch happens and P1 takes the charge, and start executing. P1 would increment the value of A (A=1). After execution P1 gives the charge again to P0.<\/p>\n<p>Now the value of A for P0 is 0 &amp; when it starts executing it would increment the value of A, from 0 to 1.<\/p>\n<p>So here, when both the processes P0 &amp; P1 end up accessing the variable A, the value of A =1 which is different from the value of A=2 in the first case.<\/p>\n<p>Now, this type of condition where the sequence of execution of the processes affects the result is called <strong>race condition<\/strong>.<\/p>\n<p>To avoid a race condition, the process should access the common resources under its critical section.\u00a0So in simple words, the critical section is that section of the process where the code for accessing shared resources is written.<\/p>\n<p>The critical section code must be design such that the process must initially request to enter its critical section. If permitted, then execute the critical section and there must be an exit section. The remaining code is under the remainder section. Below you can see the general structure to implement critical section.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-281\" src=\"https:\/\/binaryterms.com\/wp-content\/uploads\/2019\/09\/Critical-sections-general-structure.jpg\" alt=\"Critical sections general structure\" width=\"370\" height=\"254\" srcset=\"https:\/\/binaryterms.com\/wp-content\/uploads\/2019\/09\/Critical-sections-general-structure.jpg 370w, https:\/\/binaryterms.com\/wp-content\/uploads\/2019\/09\/Critical-sections-general-structure-300x206.jpg 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><\/p>\n<p><a name=\"PropertiestoImplementCriticalSection\"><\/a><\/p>\n<h3>Properties to Implement Critical Section<\/h3>\n<p>To avoid any inconsistency in the result the three properties that should be considered mandatorily to implement critical section are as follow:<\/p>\n<h4>1. Mutual Exclusion<\/h4>\n<p>Only one process can execute its critical section at a time. The other process must wait until the previous process has completed its critical section execution completely<\/p>\n<h4>2. Progress<\/h4>\n<p>If a process doesn&#8217;t want to enter in its critical section. It should not be permitted to block another process from entering it, in its critical section.<\/p>\n<h4>3. Bounded Waiting<\/h4>\n<p>There is a bounded time up to which the process has to wait to enter its critical section after making the request. The system can\u2019t keep waiting, a process for the indefinite time to enter its critical section. Anyhow the execution of the critical section takes a short duration. So, every process requesting to enter its critical section get the chance within the finite amount of time.<br \/>\n<a name=\"SolutiontoImplementCriticalSection\"><\/a><\/p>\n<h3>Solution to Implement Critical Section<\/h3>\n<p>There can be many solutions to implement critical section but, as we studied above the solution must satisfy three criteria i.e. Mutual exclusion (only one process can enter critical section at a time), Progress (a process not wishing to enter its critical section should not block a process whishing to enter its critical section) and bounded wait (a process should not have to wait for indefinite time to enter its critical region).<\/p>\n<p>Let us start to search for the solution to implement a critical section successfully. Though we have to find the solution for n number of processes but, let start with just two processes to make the understanding better and easy.<\/p>\n<p><span style=\"text-decoration: underline\"><strong>Case 1:<\/strong><\/span><\/p>\n<p>In the figure below you can see that we have two processes P0 and P1. Both have code to enter their critical section.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-274\" src=\"https:\/\/binaryterms.com\/wp-content\/uploads\/2019\/09\/Critical-section-solution-1.jpg\" alt=\"Critical section solution 1\" width=\"575\" height=\"302\" srcset=\"https:\/\/binaryterms.com\/wp-content\/uploads\/2019\/09\/Critical-section-solution-1.jpg 575w, https:\/\/binaryterms.com\/wp-content\/uploads\/2019\/09\/Critical-section-solution-1-300x158.jpg 300w\" sizes=\"auto, (max-width: 575px) 100vw, 575px\" \/><\/p>\n<p>Suppose the value of <strong>turn<\/strong> is <strong>0<\/strong>. Now, the process P0 tries to enter its critical section, it executes while(1) and further checks for the condition while (turn!=0)which turn out false. So, it exit while loop and enter the critical section and on exit make turn=1 and execute the remainder section.<\/p>\n<p>Similarly, P1 checks while (1) and enter the while loop and checks for while (turn! = 1) which turn out to be false. So P1 exit loop and enter critical section then make turn 0 again and execute its remainder section.<\/p>\n<p>Here, observe one thing that every time<strong> P0 <\/strong>need the value of <strong>turn=0 to<\/strong> enter its CS and every time <strong>P1<\/strong> need value of<strong> turn=1<\/strong> to enter its CS. So here, even if P0 after executing its CS immediately want to reenter its CS again. It has to wait for P1 to make the value of turn = 0. Here, we have achieved mutual exclusion but, progress is not achieved as if P1 does not want to enter CS it will block P0 to enter its CS.<\/p>\n<p><span style=\"text-decoration: underline\"><strong>Case 2:<\/strong><\/span><\/p>\n<p>Look at the figure below, we have now introduced a flag array, flag [0]=F, flag [1]=F.<\/p>\n<p>Now, let us begin again, P0 execute while(1) which is true so, it enters the loop make flag [0]=T which confirm that P0 want to enter CS. Now P0 checks while(flag[1])to see whether P1 is in its CS, which is false so it exits the loop and enter its CS and on exit make flag[0]=F.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-276\" src=\"https:\/\/binaryterms.com\/wp-content\/uploads\/2019\/09\/Critical-section-solution-2.jpg\" alt=\"Critical section solution 2\" width=\"586\" height=\"289\" srcset=\"https:\/\/binaryterms.com\/wp-content\/uploads\/2019\/09\/Critical-section-solution-2.jpg 586w, https:\/\/binaryterms.com\/wp-content\/uploads\/2019\/09\/Critical-section-solution-2-300x148.jpg 300w\" sizes=\"auto, (max-width: 586px) 100vw, 586px\" \/><\/p>\n<p>Now, P1 checks while (1) which is true so, it enters the loop and makes flag[1]=T which confirms that P1 wants to enter CS. Further check while (flag[0]) to check whether P0 is in its CS which is false as on exit P0 had made Flag[0]=F. So, it exit while(flag[0]) loop and enter its CS and on exit make flag[1]=F.<\/p>\n<p>If after executing it&#8217;s CS, P1 again wants to reenter its CS, it can, as the condition for entry in CS flag[0]= F. Same is the case with P0. Here we have achieved mutual exclusion +progress.<\/p>\n<p>Consider the case when P0 has just confirmed that it wants to enter CS by making flag[0]=T and just at that moment the context switch happens and P1 get charge and start executing. It makes flag[1]=T and further check for while(flag[0]) which is true now, it will get <strong>blocked<\/strong> in the loop and also blocks P0.<\/p>\n<p><span style=\"text-decoration: underline\"><strong>Case 3:<\/strong><\/span><\/p>\n<p>Here, we have implemented both flag array and the turn variable, flag[0]=F, flag[1]=F and turn=0.<\/p>\n<p>Starting with P0, it enters while (1) and make flag[0]=T and turn =1 to confirm its entry in CS. Further checks for while(turn==1 &amp;&amp; flag[1]==T) which turn out false as flag[1]=F. So, P0 enter CS and on exit make flag[0]=F.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-277\" src=\"https:\/\/binaryterms.com\/wp-content\/uploads\/2019\/09\/Petersons-solution.jpg\" alt=\"Peterson's solution\" width=\"600\" height=\"222\" srcset=\"https:\/\/binaryterms.com\/wp-content\/uploads\/2019\/09\/Petersons-solution.jpg 600w, https:\/\/binaryterms.com\/wp-content\/uploads\/2019\/09\/Petersons-solution-300x111.jpg 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><br \/>\nNow, P1 enter while(1) and make flag[1]=T and turn =0 to confirm its entry in CS. Further checks for while(turn==0 &amp;&amp; flag[0]==T) which turn out false as flag[0]=F. So P1 enter CS and on exit make flag[1]=F. Here even, if context switch happens the processes would not get into a deadlock as in the previous case. \u00a0This solution is called <strong>Peterson\u2019s solution<\/strong>.<br \/>\n<a name=\"KeyTakeaways\"><\/a><\/p>\n<div id=\"keytake\">\n<h3>Key Takeaways<\/h3>\n<ul>\n<li>There are multiple processes in the system and some of them share the common resources, so they need to be <strong>synchronized<\/strong>.<\/li>\n<li>The <strong>race condition<\/strong> is when the order of execution, of the processes, sharing a common resource, reflect the change in the result.<\/li>\n<li>To ignore race condition, the code for accessing the shared resources is written under the <strong>critical section<\/strong> of the process.<\/li>\n<li>Two or more process can never enter the critical section simultaneously.<\/li>\n<li>A process not wishing to enter its critical section, should not block the entry of another process in its critical section.<\/li>\n<li>A process should not be kept waiting for an indefinite time to enter its critical section.<\/li>\n<\/ul>\n<\/div>\n<p>This is all about the critical section. The successful implementation of the critical section avoids the race condition.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The part of the process, where the code for accessing the shared resources is written, that part or section is the critical section (CS) of that process. Now the critical section problem is to implement such a solution, which can be used by the processes to cooperate when they share common resources. To execute its [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[2],"tags":[],"class_list":{"0":"post-269","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-operating-system","7":"entry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What is Critical Section Problem in Operating System (OS)? Definition, Properties &amp; Solution - Binary Terms<\/title>\n<meta name=\"description\" content=\"The part of the process where the code for accessing shared resources is written, is the critical section of that process. To solve critical section problem\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/binaryterms.com\/critical-section-problem.html\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is Critical Section Problem in Operating System (OS)? Definition, Properties &amp; Solution - Binary Terms\" \/>\n<meta property=\"og:description\" content=\"The part of the process where the code for accessing shared resources is written, is the critical section of that process. To solve critical section problem\" \/>\n<meta property=\"og:url\" content=\"https:\/\/binaryterms.com\/critical-section-problem.html\" \/>\n<meta property=\"og:site_name\" content=\"Binary Terms\" \/>\n<meta property=\"article:published_time\" content=\"2019-09-04T10:19:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-10T08:43:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/binaryterms.com\/wp-content\/uploads\/2019\/09\/Race-Condition.jpg\" \/>\n<meta name=\"author\" content=\"Neha T\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Neha T\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/binaryterms.com\/critical-section-problem.html#article\",\"isPartOf\":{\"@id\":\"https:\/\/binaryterms.com\/critical-section-problem.html\"},\"author\":{\"name\":\"Neha T\",\"@id\":\"https:\/\/binaryterms.com\/#\/schema\/person\/e495f1d57f5c0a4c521cc3dba95661fe\"},\"headline\":\"Critical Section Problem\",\"datePublished\":\"2019-09-04T10:19:27+00:00\",\"dateModified\":\"2021-02-10T08:43:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/binaryterms.com\/critical-section-problem.html\"},\"wordCount\":1480,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/binaryterms.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/binaryterms.com\/critical-section-problem.html#primaryimage\"},\"thumbnailUrl\":\"https:\/\/binaryterms.com\/wp-content\/uploads\/2019\/09\/Race-Condition.jpg\",\"articleSection\":[\"Operating System\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/binaryterms.com\/critical-section-problem.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/binaryterms.com\/critical-section-problem.html\",\"url\":\"https:\/\/binaryterms.com\/critical-section-problem.html\",\"name\":\"What is Critical Section Problem in Operating System (OS)? Definition, Properties & Solution - Binary Terms\",\"isPartOf\":{\"@id\":\"https:\/\/binaryterms.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/binaryterms.com\/critical-section-problem.html#primaryimage\"},\"image\":{\"@id\":\"https:\/\/binaryterms.com\/critical-section-problem.html#primaryimage\"},\"thumbnailUrl\":\"https:\/\/binaryterms.com\/wp-content\/uploads\/2019\/09\/Race-Condition.jpg\",\"datePublished\":\"2019-09-04T10:19:27+00:00\",\"dateModified\":\"2021-02-10T08:43:38+00:00\",\"description\":\"The part of the process where the code for accessing shared resources is written, is the critical section of that process. To solve critical section problem\",\"breadcrumb\":{\"@id\":\"https:\/\/binaryterms.com\/critical-section-problem.html#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/binaryterms.com\/critical-section-problem.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/binaryterms.com\/critical-section-problem.html#primaryimage\",\"url\":\"https:\/\/binaryterms.com\/wp-content\/uploads\/2019\/09\/Race-Condition.jpg\",\"contentUrl\":\"https:\/\/binaryterms.com\/wp-content\/uploads\/2019\/09\/Race-Condition.jpg\",\"width\":399,\"height\":221,\"caption\":\"Race Condition\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/binaryterms.com\/critical-section-problem.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/binaryterms.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Critical Section Problem\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/binaryterms.com\/#website\",\"url\":\"https:\/\/binaryterms.com\/\",\"name\":\"Binary Terms\",\"description\":\"The Computer Science &amp; IT Guide\",\"publisher\":{\"@id\":\"https:\/\/binaryterms.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/binaryterms.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/binaryterms.com\/#organization\",\"name\":\"Binary Terms\",\"url\":\"https:\/\/binaryterms.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/binaryterms.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/binaryterms.com\/wp-content\/uploads\/2020\/05\/binary-terms-logo1.png\",\"contentUrl\":\"https:\/\/binaryterms.com\/wp-content\/uploads\/2020\/05\/binary-terms-logo1.png\",\"width\":400,\"height\":63,\"caption\":\"Binary Terms\"},\"image\":{\"@id\":\"https:\/\/binaryterms.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/binaryterms.com\/#\/schema\/person\/e495f1d57f5c0a4c521cc3dba95661fe\",\"name\":\"Neha T\",\"url\":\"https:\/\/binaryterms.com\/author\/author\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is Critical Section Problem in Operating System (OS)? Definition, Properties & Solution - Binary Terms","description":"The part of the process where the code for accessing shared resources is written, is the critical section of that process. To solve critical section problem","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/binaryterms.com\/critical-section-problem.html","og_locale":"en_GB","og_type":"article","og_title":"What is Critical Section Problem in Operating System (OS)? Definition, Properties & Solution - Binary Terms","og_description":"The part of the process where the code for accessing shared resources is written, is the critical section of that process. To solve critical section problem","og_url":"https:\/\/binaryterms.com\/critical-section-problem.html","og_site_name":"Binary Terms","article_published_time":"2019-09-04T10:19:27+00:00","article_modified_time":"2021-02-10T08:43:38+00:00","og_image":[{"url":"https:\/\/binaryterms.com\/wp-content\/uploads\/2019\/09\/Race-Condition.jpg","type":"","width":"","height":""}],"author":"Neha T","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Neha T","Estimated reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/binaryterms.com\/critical-section-problem.html#article","isPartOf":{"@id":"https:\/\/binaryterms.com\/critical-section-problem.html"},"author":{"name":"Neha T","@id":"https:\/\/binaryterms.com\/#\/schema\/person\/e495f1d57f5c0a4c521cc3dba95661fe"},"headline":"Critical Section Problem","datePublished":"2019-09-04T10:19:27+00:00","dateModified":"2021-02-10T08:43:38+00:00","mainEntityOfPage":{"@id":"https:\/\/binaryterms.com\/critical-section-problem.html"},"wordCount":1480,"commentCount":1,"publisher":{"@id":"https:\/\/binaryterms.com\/#organization"},"image":{"@id":"https:\/\/binaryterms.com\/critical-section-problem.html#primaryimage"},"thumbnailUrl":"https:\/\/binaryterms.com\/wp-content\/uploads\/2019\/09\/Race-Condition.jpg","articleSection":["Operating System"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/binaryterms.com\/critical-section-problem.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/binaryterms.com\/critical-section-problem.html","url":"https:\/\/binaryterms.com\/critical-section-problem.html","name":"What is Critical Section Problem in Operating System (OS)? Definition, Properties & Solution - Binary Terms","isPartOf":{"@id":"https:\/\/binaryterms.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/binaryterms.com\/critical-section-problem.html#primaryimage"},"image":{"@id":"https:\/\/binaryterms.com\/critical-section-problem.html#primaryimage"},"thumbnailUrl":"https:\/\/binaryterms.com\/wp-content\/uploads\/2019\/09\/Race-Condition.jpg","datePublished":"2019-09-04T10:19:27+00:00","dateModified":"2021-02-10T08:43:38+00:00","description":"The part of the process where the code for accessing shared resources is written, is the critical section of that process. To solve critical section problem","breadcrumb":{"@id":"https:\/\/binaryterms.com\/critical-section-problem.html#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/binaryterms.com\/critical-section-problem.html"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/binaryterms.com\/critical-section-problem.html#primaryimage","url":"https:\/\/binaryterms.com\/wp-content\/uploads\/2019\/09\/Race-Condition.jpg","contentUrl":"https:\/\/binaryterms.com\/wp-content\/uploads\/2019\/09\/Race-Condition.jpg","width":399,"height":221,"caption":"Race Condition"},{"@type":"BreadcrumbList","@id":"https:\/\/binaryterms.com\/critical-section-problem.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/binaryterms.com\/"},{"@type":"ListItem","position":2,"name":"Critical Section Problem"}]},{"@type":"WebSite","@id":"https:\/\/binaryterms.com\/#website","url":"https:\/\/binaryterms.com\/","name":"Binary Terms","description":"The Computer Science &amp; IT Guide","publisher":{"@id":"https:\/\/binaryterms.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/binaryterms.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/binaryterms.com\/#organization","name":"Binary Terms","url":"https:\/\/binaryterms.com\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/binaryterms.com\/#\/schema\/logo\/image\/","url":"https:\/\/binaryterms.com\/wp-content\/uploads\/2020\/05\/binary-terms-logo1.png","contentUrl":"https:\/\/binaryterms.com\/wp-content\/uploads\/2020\/05\/binary-terms-logo1.png","width":400,"height":63,"caption":"Binary Terms"},"image":{"@id":"https:\/\/binaryterms.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/binaryterms.com\/#\/schema\/person\/e495f1d57f5c0a4c521cc3dba95661fe","name":"Neha T","url":"https:\/\/binaryterms.com\/author\/author"}]}},"_links":{"self":[{"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/posts\/269","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/comments?post=269"}],"version-history":[{"count":1,"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/posts\/269\/revisions"}],"predecessor-version":[{"id":2357,"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/posts\/269\/revisions\/2357"}],"wp:attachment":[{"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/media?parent=269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/categories?post=269"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/tags?post=269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}