{"id":380,"date":"2024-06-28T12:49:30","date_gmt":"2024-06-28T12:49:30","guid":{"rendered":"https:\/\/study.madeeasy.in\/?p=380"},"modified":"2025-07-16T14:43:49","modified_gmt":"2025-07-16T09:13:49","slug":"what-is-cpu-scheduling-and-its-types","status":"publish","type":"post","link":"https:\/\/www.madeeasy.in\/study\/cs-it\/operating-system\/what-is-cpu-scheduling-and-its-types","title":{"rendered":"What is CPU Scheduling and its types?"},"content":{"rendered":"\r\n<p style=\"text-align: justify;\">CPU scheduler schedules a process which is loaded in memory (Ready state) to run in CPU.<\/p>\r\n<h2 style=\"text-align: justify;\">Types of Scheduling Algorithm<\/h2>\r\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_79_1 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.madeeasy.in\/study\/cs-it\/operating-system\/what-is-cpu-scheduling-and-its-types\/#FCFS\" >FCFS<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.madeeasy.in\/study\/cs-it\/operating-system\/what-is-cpu-scheduling-and-its-types\/#Shortest-Job-First-SJF-Or-Shortest-Process-Next\" >Shortest Job First (SJF) Or Shortest Process Next<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.madeeasy.in\/study\/cs-it\/operating-system\/what-is-cpu-scheduling-and-its-types\/#Shortest-Remaining-Time-First-SRTF\" >Shortest Remaining Time First (SRTF)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.madeeasy.in\/study\/cs-it\/operating-system\/what-is-cpu-scheduling-and-its-types\/#Round-Robin-Scheduling-RR\" >Round Robin Scheduling (RR)<\/a><\/li><\/ul><\/nav><\/div>\n<h3 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"FCFS\"><\/span>FCFS<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<ul style=\"text-align: justify;\">\r\n<li>FCFS is implemented using queue which serves in first in first out manner.<\/li>\r\n<li>Processes are assigned to the CPU based on their order of requests (order of arrivals)<\/li>\r\n<li>\u201cReady queue\u201d maintains all processes in their arrival orders.<\/li>\r\n<li>FCFS scheduling is non-preemptive algorithm.<\/li>\r\n<\/ul>\r\n<h3 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Shortest-Job-First-SJF-Or-Shortest-Process-Next\"><\/span>Shortest Job First (SJF) Or Shortest Process Next<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<ul style=\"text-align: justify;\">\r\n<li>SJF schedules a process based on the selection of smallest (shortest) burst time of processes.<\/li>\r\n<li>SJF is non-preemptive algorithm.<\/li>\r\n<\/ul>\r\n<h3 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Shortest-Remaining-Time-First-SRTF\"><\/span>Shortest Remaining Time First (SRTF)<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<ul style=\"text-align: justify;\">\r\n<li>SRTF scheduling is similar to SJF, only the difference is SRTF can preempt the job while it is executing in CPU if any smaller job needs to execute compared to remaining time of current job.<\/li>\r\n<\/ul>\r\n<h3 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Round-Robin-Scheduling-RR\"><\/span>Round Robin Scheduling (RR)<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p style=\"text-align: justify;\">It is the preemptive scheduling in which every process gets executed in a cyclic way, i.e., in this a particular time slice is allocated to each process which is known as time quantum.<\/p>\r\n\r\n\r\n\r\n<p style=\"text-align: center;\"><a class=\"btn btn-danger\" role=\"button\" href=\"https:\/\/study.madeeasy.in\/cs-it\/operating-system\/what-is-thread-in-operating-system\/\" target=\"_blank\" rel=\"noopener\">&lt;&lt; Previous<\/a> | <a class=\"btn btn-success\" role=\"button\" href=\"https:\/\/study.madeeasy.in\/cs-it\/operating-system\/what-is-deadlock-in-operating-system-os\/\" target=\"_blank\" rel=\"noopener\"> Next &gt;&gt;<\/a> <br \/><strong> Must Read: <\/strong> <a href=\"https:\/\/study.madeeasy.in\/subjects\/what-is-an-operating-system-and-its-types\/\" target=\"_blank\" rel=\"noopener\"><strong>What is an operating system and its types?<\/strong><\/a><\/p>\r\n<p>&nbsp;<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>CPU scheduler schedules a process which is loaded in memory (Ready state) to run in CPU. Types of Scheduling Algorithm<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[94,3],"tags":[105,106],"class_list":["post-380","post","type-post","status-publish","format-standard","hentry","category-operating-system","category-cs-it","tag-cpu-scheduling","tag-scheduling-algorithm"],"_links":{"self":[{"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/posts\/380","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=380"}],"version-history":[{"count":0,"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/posts\/380\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/media?parent=380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/categories?post=380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.madeeasy.in\/study\/wp-json\/wp\/v2\/tags?post=380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}