{"id":67,"date":"2025-01-08T03:56:54","date_gmt":"2025-01-08T03:56:54","guid":{"rendered":"https:\/\/mitalgoswami.in\/?p=67"},"modified":"2025-07-17T06:51:02","modified_gmt":"2025-07-17T06:51:02","slug":"rr-algorithm","status":"publish","type":"post","link":"https:\/\/mitalgoswami.in\/?p=67","title":{"rendered":"RR Algorithm"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\"><strong>Solving the Round Robin (RR) Scheduling Algorithm<\/strong><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Given Data:<\/strong><\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Processes: P1, P2, P3<\/li>\n\n\n\n<li>Burst Times (BT):\n<ul class=\"wp-block-list\">\n<li>P1 = 24<\/li>\n\n\n\n<li>P2 = 3<\/li>\n\n\n\n<li>P3 = 3<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Time Quantum = 4<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 1: Gantt Chart Construction<\/strong><\/h3>\n\n\n\n<p>Using a time quantum of 4, we allocate the CPU to each process in a round-robin manner.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Time Slice 1:<\/strong>\n<ul class=\"wp-block-list\">\n<li>P1 executes for 4 units (remaining = 24 &#8211; 4 = 20).<\/li>\n\n\n\n<li>P2 completes execution (remaining = 3 &#8211; 3 = 0).<\/li>\n\n\n\n<li>P3 completes execution (remaining = 3 &#8211; 3 = 0).<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Time Slice 2:<\/strong>\n<ul class=\"wp-block-list\">\n<li>P1 executes for another 4 units (remaining = 20 &#8211; 4 = 16).<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Repeat Process:<\/strong>\n<ul class=\"wp-block-list\">\n<li>P1 continues to execute until it completes.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Gantt Chart<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Time<\/th><th>Process<\/th><\/tr><\/thead><tbody><tr><td>0 &#8211; 4<\/td><td>P1<\/td><\/tr><tr><td>4 &#8211; 7<\/td><td>P2<\/td><\/tr><tr><td>7 &#8211; 10<\/td><td>P3<\/td><\/tr><tr><td>10 &#8211; 14<\/td><td>P1<\/td><\/tr><tr><td>14 &#8211; 18<\/td><td>P1<\/td><\/tr><tr><td>18 &#8211; 22<\/td><td>P1<\/td><\/tr><tr><td>22 &#8211; 26<\/td><td>P1<\/td><\/tr><tr><td>26 &#8211; 30<\/td><td>P1<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 2: Completion Time<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>P1:<\/strong> Finishes at t=30t = 30t=30<\/li>\n\n\n\n<li><strong>P2:<\/strong> Finishes at t=7t = 7t=7<\/li>\n\n\n\n<li><strong>P3:<\/strong> Finishes at t=10t = 10t=10<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 3: Turnaround Time (TAT)<\/strong><\/h3>\n\n\n\n<p><strong>Step 3: Turnaround Time (TAT)<\/strong><\/p>\n\n\n\n<p>TAT=Completion\u00a0Time\u00a0(CT)\u2212Arrival\u00a0Time\u00a0(AT)<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Process<\/th><th>Completion Time (CT)<\/th><th>Arrival Time (AT)<\/th><th>Turnaround Time (TAT)<\/th><\/tr><\/thead><tbody><tr><td>P1<\/td><td>30<\/td><td>0<\/td><td>30<\/td><\/tr><tr><td>P2<\/td><td>7<\/td><td>0<\/td><td>7<\/td><\/tr><tr><td>P3<\/td><td>10<\/td><td>0<\/td><td>10<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 4: Waiting Time (WT)<\/strong><\/h3>\n\n\n\n<p>WT=TAT\u2212Burst\u00a0Time\u00a0(BT)<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Process<\/th><th>Turnaround Time (TAT)<\/th><th>Burst Time (BT)<\/th><th>Waiting Time (WT)<\/th><\/tr><\/thead><tbody><tr><td>P1<\/td><td>30<\/td><td>24<\/td><td>6<\/td><\/tr><tr><td>P2<\/td><td>7<\/td><td>3<\/td><td>4<\/td><\/tr><tr><td>P3<\/td><td>10<\/td><td>3<\/td><td>7<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Final Results:<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Process<\/th><th>Burst Time (BT)<\/th><th>Completion Time (CT)<\/th><th>Turnaround Time (TAT)<\/th><th>Waiting Time (WT)<\/th><\/tr><\/thead><tbody><tr><td>P1<\/td><td>24<\/td><td>30<\/td><td>30<\/td><td>6<\/td><\/tr><tr><td>P2<\/td><td>3<\/td><td>7<\/td><td>7<\/td><td>4<\/td><\/tr><tr><td>P3<\/td><td>3<\/td><td>10<\/td><td>10<\/td><td>7<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Average Times:<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Average Turnaround Time (TAT):<\/strong>Average\u00a0TAT=30+7+10\/3=15.67<\/li>\n\n\n\n<li><strong>Average Waiting Time (WT):<\/strong>Average\u00a0WT=6+4+7\/3=5.67<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Solving the Round Robin (RR) Scheduling Algorithm Given Data: Step 1: Gantt Chart Construction Using a time quantum of 4, we allocate the CPU to each process in a round-robin manner. Gantt Chart Time Process 0 &#8211; 4 P1 4 &#8211; 7 P2 7 &#8211; 10 P3 10 &#8211; 14 P1 14 &#8211; 18 P1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-67","post","type-post","status-publish","format-standard","hentry","category-unix"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=\/wp\/v2\/posts\/67","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=67"}],"version-history":[{"count":1,"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=\/wp\/v2\/posts\/67\/revisions"}],"predecessor-version":[{"id":68,"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=\/wp\/v2\/posts\/67\/revisions\/68"}],"wp:attachment":[{"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mitalgoswami.in\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}