{"id":154151,"date":"2023-08-02T15:40:35","date_gmt":"2023-08-02T10:10:35","guid":{"rendered":"https:\/\/www.gkseries.com\/blog\/?p=154151"},"modified":"2023-08-02T15:40:41","modified_gmt":"2023-08-02T10:10:41","slug":"consider-the-following-four-processes-with-arrival-times-in-milliseconds-and-their-length-of-cpu-bursts-in-milliseconds-as-shown-below","status":"publish","type":"post","link":"https:\/\/www.gkseries.com\/blog\/consider-the-following-four-processes-with-arrival-times-in-milliseconds-and-their-length-of-cpu-bursts-in-milliseconds-as-shown-below\/","title":{"rendered":"Consider the following four processes with arrival times (in milliseconds) and their length of CPU bursts (in milliseconds) as shown below"},"content":{"rendered":"\n<p>Q. Consider the following four processes with arrival times (in milliseconds) and their length of CPU bursts (in milliseconds) as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Process<\/td><td>P1<\/td><td>P2<\/td><td>P3<\/td><td>P4<\/td><\/tr><tr><td>Arrival time<\/td><td>0<\/td><td>1<\/td><td>3<\/td><td>4<\/td><\/tr><tr><td>CPU burst time<\/td><td>3<\/td><td>1<\/td><td>3<\/td><td>Z<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>These processes are run on a single processor using preemptive Shortest Remaining Time First scheduling algorithm. If the average waiting time of the processes is 1 millisecond, then the value of Z is\u00a0\u00a0<\/p>\n\n\n\n<p>\u00a0Ans:\u00a0<\/p>\n\n\n\n<p>This is the Gantt chart till time = 4 units<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/www.gkseries.com\/blog\/wp-content\/uploads\/2023\/08\/image-4.png\" alt=\"\" class=\"wp-image-154152\" width=\"319\" height=\"70\" srcset=\"https:\/\/www.gkseries.com\/blog\/wp-content\/uploads\/2023\/08\/image-4.png 430w, https:\/\/www.gkseries.com\/blog\/wp-content\/uploads\/2023\/08\/image-4-300x66.png 300w\" sizes=\"(max-width: 319px) 100vw, 319px\" \/><\/figure>\n\n\n\n<p>At this point P4 arrives with burst &#8216;Z&#8217; &amp; P3 is in queue with burst 3.<br>P1 &amp; P2 have executed with P1 incurred delay 1unit &amp; P2 0units.<br>Hence, Avg = 0+1+x\/4 =1<br>\u21d2 x=3, the next delay should be 3. It would happen if assume Z=2.<br>It executes and completes at 6.<br>P3 will wait totally for 3units.<br>Hence, Avg=1.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/www.gkseries.com\/blog\/wp-content\/uploads\/2023\/08\/image-5.png\" alt=\"\" class=\"wp-image-154153\" width=\"408\" height=\"66\" srcset=\"https:\/\/www.gkseries.com\/blog\/wp-content\/uploads\/2023\/08\/image-5.png 498w, https:\/\/www.gkseries.com\/blog\/wp-content\/uploads\/2023\/08\/image-5-300x48.png 300w\" sizes=\"(max-width: 408px) 100vw, 408px\" \/><\/figure>\n\n\n\n<p>z=2<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Q. Consider the following four processes with arrival times (in milliseconds) and their length of CPU bursts (in milliseconds) as shown below: Process P1 P2 P3 P4 Arrival time 0 1 3 4 CPU burst time 3 1 3 Z These processes are run on a single processor using preemptive Shortest Remaining Time First scheduling [&hellip;]<\/p>\n","protected":false},"author":419,"featured_media":154154,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[5141],"tags":[5140],"class_list":["post-154151","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-gate","tag-gate-questions"],"_links":{"self":[{"href":"https:\/\/www.gkseries.com\/blog\/wp-json\/wp\/v2\/posts\/154151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gkseries.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gkseries.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gkseries.com\/blog\/wp-json\/wp\/v2\/users\/419"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gkseries.com\/blog\/wp-json\/wp\/v2\/comments?post=154151"}],"version-history":[{"count":1,"href":"https:\/\/www.gkseries.com\/blog\/wp-json\/wp\/v2\/posts\/154151\/revisions"}],"predecessor-version":[{"id":154155,"href":"https:\/\/www.gkseries.com\/blog\/wp-json\/wp\/v2\/posts\/154151\/revisions\/154155"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gkseries.com\/blog\/wp-json\/wp\/v2\/media\/154154"}],"wp:attachment":[{"href":"https:\/\/www.gkseries.com\/blog\/wp-json\/wp\/v2\/media?parent=154151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gkseries.com\/blog\/wp-json\/wp\/v2\/categories?post=154151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gkseries.com\/blog\/wp-json\/wp\/v2\/tags?post=154151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}