{"id":3282,"date":"2025-06-06T14:04:29","date_gmt":"2025-06-06T14:04:29","guid":{"rendered":"https:\/\/diznr.com\/?p=3282"},"modified":"2025-06-06T14:04:29","modified_gmt":"2025-06-06T14:04:29","slug":"day-01-part-17a-schedulers-in-operating-system-long-term-short-term-and-midium-schedulers-term","status":"publish","type":"post","link":"https:\/\/www.reilsolar.com\/pdf\/day-01-part-17a-schedulers-in-operating-system-long-term-short-term-and-midium-schedulers-term\/","title":{"rendered":"Day 01 Part 17(A)- Schedulers in operating system long term, short term and midium term schedulers."},"content":{"rendered":"<p>Day 01 Part 17(A)- Schedulers in operating system long term, short term and midium term schedulers<\/p>\n<p>[fvplayer id=&#8221;333&#8243;]<\/p>\n<h3 data-start=\"0\" data-end=\"97\"><strong data-start=\"4\" data-end=\"95\">\u00a0Schedulers in Operating System (OS) \u2013 Long-Term, Short-Term &amp; Medium-Term Schedulers<\/strong><\/h3>\n<p data-start=\"99\" data-end=\"273\">Schedulers in an <strong data-start=\"116\" data-end=\"141\">Operating System (OS)<\/strong> are responsible for managing process execution by selecting processes to run in the CPU. There are <strong data-start=\"241\" data-end=\"270\">three types of schedulers<\/strong>:<\/p>\n<p data-start=\"275\" data-end=\"409\"><strong data-start=\"279\" data-end=\"318\">Long-Term Scheduler (Job Scheduler)<\/strong><br data-start=\"318\" data-end=\"321\" \/><strong data-start=\"325\" data-end=\"365\">Short-Term Scheduler (CPU Scheduler)<\/strong><br data-start=\"365\" data-end=\"368\" \/><strong data-start=\"372\" data-end=\"407\">Medium-Term Scheduler (Swapper)<\/strong><\/p>\n<h3 data-start=\"416\" data-end=\"467\"><strong data-start=\"419\" data-end=\"465\">\u00a0Long-Term Scheduler (Job Scheduler)<\/strong><\/h3>\n<p data-start=\"468\" data-end=\"941\"><strong data-start=\"470\" data-end=\"483\">Function:<\/strong> Selects which processes should be admitted into the <strong data-start=\"536\" data-end=\"551\">ready queue<\/strong> from the job pool.<br data-start=\"570\" data-end=\"573\" \/><strong data-start=\"575\" data-end=\"589\">Frequency:<\/strong> Runs <strong data-start=\"595\" data-end=\"611\">infrequently<\/strong> (e.g., once every few seconds or minutes).<br data-start=\"654\" data-end=\"657\" \/><strong data-start=\"659\" data-end=\"676\">Main Purpose:<\/strong> Controls <strong data-start=\"686\" data-end=\"716\">degree of multiprogramming<\/strong> (number of processes in memory).<br data-start=\"749\" data-end=\"752\" \/><strong data-start=\"754\" data-end=\"767\">Works in:<\/strong> <strong data-start=\"768\" data-end=\"785\">Batch Systems<\/strong> (e.g., old mainframe systems).<br data-start=\"816\" data-end=\"819\" \/><strong data-start=\"821\" data-end=\"833\">Example:<\/strong> If there are <strong data-start=\"847\" data-end=\"880\">100 processes in the job pool<\/strong>, the long-term scheduler <strong data-start=\"906\" data-end=\"920\">chooses 10<\/strong> to bring into RAM.<\/p>\n<p data-start=\"943\" data-end=\"1007\"><strong data-start=\"945\" data-end=\"958\">Key Role:<\/strong> Determines which programs <strong data-start=\"985\" data-end=\"1004\">enter execution<\/strong>.<\/p>\n<h3 data-start=\"1014\" data-end=\"1066\"><strong data-start=\"1017\" data-end=\"1064\">\u00a0Short-Term Scheduler (CPU Scheduler)<\/strong><\/h3>\n<p data-start=\"1067\" data-end=\"1474\"><strong data-start=\"1069\" data-end=\"1082\">Function:<\/strong> Selects which process will execute next in the <strong data-start=\"1130\" data-end=\"1137\">CPU<\/strong> from the ready queue.<br data-start=\"1159\" data-end=\"1162\" \/><strong data-start=\"1164\" data-end=\"1178\">Frequency:<\/strong> Runs <strong data-start=\"1184\" data-end=\"1203\">very frequently<\/strong> (millisecond level).<br data-start=\"1224\" data-end=\"1227\" \/><strong data-start=\"1229\" data-end=\"1246\">Main Purpose:<\/strong> <strong data-start=\"1247\" data-end=\"1286\">Decides which process gets CPU time<\/strong> for execution.<br data-start=\"1301\" data-end=\"1304\" \/><strong data-start=\"1306\" data-end=\"1319\">Works in:<\/strong> All systems (<strong data-start=\"1333\" data-end=\"1367\">Batch, Time-Sharing, Real-Time<\/strong>).<br data-start=\"1369\" data-end=\"1372\" \/><strong data-start=\"1374\" data-end=\"1386\">Example:<\/strong> A process in the ready queue gets scheduled <strong data-start=\"1431\" data-end=\"1457\">every few milliseconds<\/strong> for execution.<\/p>\n<p data-start=\"1476\" data-end=\"1539\"><strong data-start=\"1478\" data-end=\"1491\">Key Role:<\/strong> Improves <strong data-start=\"1501\" data-end=\"1536\">CPU utilization &amp; response time<\/strong>.<\/p>\n<h4 data-start=\"1546\" data-end=\"1593\"><strong data-start=\"1549\" data-end=\"1591\">\u00a0Medium-Term Scheduler (Swapper)<\/strong><\/h4>\n<p data-start=\"1594\" data-end=\"2022\"><strong data-start=\"1596\" data-end=\"1609\">Function:<\/strong> Removes some processes from memory (swaps out) and brings them back later (swaps in).<br data-start=\"1695\" data-end=\"1698\" \/><strong data-start=\"1700\" data-end=\"1714\">Frequency:<\/strong> Runs <strong data-start=\"1720\" data-end=\"1736\">occasionally<\/strong>, based on memory needs.<br data-start=\"1760\" data-end=\"1763\" \/><strong data-start=\"1765\" data-end=\"1782\">Main Purpose:<\/strong> Reduces <strong data-start=\"1791\" data-end=\"1806\">memory load<\/strong> and improves <strong data-start=\"1820\" data-end=\"1838\">CPU efficiency<\/strong>.<br data-start=\"1839\" data-end=\"1842\" \/><strong data-start=\"1844\" data-end=\"1857\">Works in:<\/strong> <strong data-start=\"1858\" data-end=\"1899\">Time-Sharing &amp; Virtual Memory Systems<\/strong>.<br data-start=\"1900\" data-end=\"1903\" \/><strong data-start=\"1905\" data-end=\"1917\">Example:<\/strong> If <strong data-start=\"1921\" data-end=\"1936\">RAM is full<\/strong>, it moves an inactive process to <strong data-start=\"1970\" data-end=\"1978\">disk<\/strong> (swap space) and loads an active process.<\/p>\n<p data-start=\"2024\" data-end=\"2098\"><strong data-start=\"2026\" data-end=\"2039\">Key Role:<\/strong> Manages <strong data-start=\"2048\" data-end=\"2073\">swapping of processes<\/strong> to optimize RAM usage.<\/p>\n<h3 data-start=\"2105\" data-end=\"2141\"><strong data-start=\"2108\" data-end=\"2139\">\u00a0Comparison of Schedulers<\/strong><\/h3>\n<div class=\"overflow-x-auto contain-inline-size\">\n<table data-start=\"2143\" data-end=\"2691\">\n<thead data-start=\"2143\" data-end=\"2239\">\n<tr data-start=\"2143\" data-end=\"2239\">\n<th data-start=\"2143\" data-end=\"2157\"><strong data-start=\"2145\" data-end=\"2156\">Feature<\/strong><\/th>\n<th data-start=\"2157\" data-end=\"2183\"><strong data-start=\"2159\" data-end=\"2182\">Long-Term Scheduler<\/strong><\/th>\n<th data-start=\"2183\" data-end=\"2210\"><strong data-start=\"2185\" data-end=\"2209\">Short-Term Scheduler<\/strong><\/th>\n<th data-start=\"2210\" data-end=\"2239\"><strong data-start=\"2212\" data-end=\"2237\">Medium-Term Scheduler<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody data-start=\"2309\" data-end=\"2691\">\n<tr data-start=\"2309\" data-end=\"2369\">\n<td><strong data-start=\"2311\" data-end=\"2325\">Other Name<\/strong><\/td>\n<td>Job Scheduler<\/td>\n<td>CPU Scheduler<\/td>\n<td>Swapper<\/td>\n<\/tr>\n<tr data-start=\"2370\" data-end=\"2491\">\n<td><strong data-start=\"2372\" data-end=\"2383\">Purpose<\/strong><\/td>\n<td>Selects which processes enter RAM<\/td>\n<td>Selects which process gets CPU time<\/td>\n<td>Manages swapping of processes<\/td>\n<\/tr>\n<tr data-start=\"2492\" data-end=\"2572\">\n<td><strong data-start=\"2494\" data-end=\"2507\">Frequency<\/strong><\/td>\n<td>Runs infrequently<\/td>\n<td>Runs very frequently<\/td>\n<td>Runs occasionally<\/td>\n<\/tr>\n<tr data-start=\"2573\" data-end=\"2621\">\n<td><strong data-start=\"2575\" data-end=\"2584\">Speed<\/strong><\/td>\n<td>Slowest<\/td>\n<td>Fastest<\/td>\n<td>Medium speed<\/td>\n<\/tr>\n<tr data-start=\"2622\" data-end=\"2691\">\n<td><strong data-start=\"2624\" data-end=\"2635\">Affects<\/strong><\/td>\n<td>Multiprogramming level<\/td>\n<td>CPU efficiency<\/td>\n<td>RAM usage<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3 data-start=\"2698\" data-end=\"2732\"><strong data-start=\"2701\" data-end=\"2730\">\u00a0Key Points to Remember<\/strong><\/h3>\n<p data-start=\"2733\" data-end=\"2948\"><strong data-start=\"2735\" data-end=\"2758\">Long-Term Scheduler<\/strong> \u2192 Decides <strong data-start=\"2769\" data-end=\"2799\">which jobs enter execution<\/strong><br data-start=\"2799\" data-end=\"2802\" \/><strong data-start=\"2804\" data-end=\"2828\">Short-Term Scheduler<\/strong> \u2192 Decides <strong data-start=\"2839\" data-end=\"2866\">which job gets CPU time<\/strong><br data-start=\"2866\" data-end=\"2869\" \/><strong data-start=\"2871\" data-end=\"2896\">Medium-Term Scheduler<\/strong> \u2192 Decides <strong data-start=\"2907\" data-end=\"2946\">which jobs to swap (suspend\/resume)<\/strong><\/p>\n<p data-start=\"2950\" data-end=\"3057\" data-is-last-node=\"\" data-is-only-node=\"\">Would you like <strong data-start=\"2965\" data-end=\"3002\">examples of scheduling algorithms<\/strong> like <strong data-start=\"3008\" data-end=\"3053\">FCFS, Round Robin, or Priority Scheduling<\/strong>?<\/p>\n<h3 data-start=\"2950\" data-end=\"3057\"><a href=\"https:\/\/home.adelphi.edu\/~siegfried\/cs553\/553l9.pdf\" target=\"_blank\" rel=\"noopener\">Day 01 Part 17(A)- Schedulers in operating system long term, short term and midium term schedulers.<\/a><\/h3>\n<div class=\"kb0PBd A9Y9g jGGQ5e\" data-snf=\"x5WNvb\" data-snhf=\"0\">\n<div class=\"yuRUbf\">\n<div class=\"b8lM7\">\n<h3 class=\"LC20lb MBeuO DKV0Md\"><a href=\"https:\/\/www.cs.put.poznan.pl\/akobusinska\/downloads\/Operating_Systems_Concepts.pdf\" target=\"_blank\" rel=\"noopener\">Operating System Concepts (7th Edition) 600 dpi<\/a><\/h3>\n<p>Here\u2019s a <strong>simple, clear explanation<\/strong> of <strong>Schedulers in Operating System<\/strong> (Day 01 Part 17(A)) \u2014 covering <strong>Long-term, Short-term, and Medium-term Schedulers<\/strong> \u2014 useful for beginners, competitive exams, and CS students.<\/p>\n<hr \/>\n<h2>\ud83d\udda5\ufe0f <strong>Schedulers in Operating System<\/strong><\/h2>\n<p>Schedulers are components of the OS that <strong>manage process execution<\/strong> by selecting which process will run <strong>when and where<\/strong>.<\/p>\n<p>There are <strong>3 types<\/strong>:<\/p>\n<hr \/>\n<h2>\ud83d\udd36 1. <strong>Long-Term Scheduler (Job Scheduler)<\/strong><\/h2>\n<h3>\ud83d\udccc <strong>Purpose:<\/strong><\/h3>\n<p>Controls the <strong>admission of processes<\/strong> into the system (from job pool to ready queue).<\/p>\n<table>\n<thead>\n<tr>\n<th>Feature<\/th>\n<th>Details<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Selects<\/td>\n<td><strong>Which jobs to admit<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Controls<\/td>\n<td>Degree of <strong>multiprogramming<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Frequency<\/td>\n<td>Runs <strong>less frequently<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Input Queue<\/td>\n<td>Job Pool \u2192 Ready Queue<\/td>\n<\/tr>\n<tr>\n<td>Involved in<\/td>\n<td><strong>Batch systems<\/strong> mostly<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\ud83d\udd38 Example:<\/strong> Choosing 5 out of 100 stored jobs to bring into memory.<\/p>\n<hr \/>\n<h2>\ud83d\udd37 2. <strong>Short-Term Scheduler (CPU Scheduler)<\/strong><\/h2>\n<h3>\ud83d\udccc <strong>Purpose:<\/strong><\/h3>\n<p>Selects one process from the <strong>ready queue<\/strong> and assigns it to the <strong>CPU<\/strong>.<\/p>\n<table>\n<thead>\n<tr>\n<th>Feature<\/th>\n<th>Details<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Selects<\/td>\n<td><strong>Which process runs next<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Controls<\/td>\n<td>CPU execution<\/td>\n<\/tr>\n<tr>\n<td>Frequency<\/td>\n<td>Runs <strong>very frequently<\/strong> (ms level)<\/td>\n<\/tr>\n<tr>\n<td>Input Queue<\/td>\n<td>Ready Queue \u2192 CPU<\/td>\n<\/tr>\n<tr>\n<td>Works in<\/td>\n<td>All systems (batch, time-sharing)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\ud83d\udd39 Example:<\/strong> Picks one process to run when a running process finishes or is interrupted.<\/p>\n<hr \/>\n<h2>\ud83d\udfe2 3. <strong>Medium-Term Scheduler (Swapper)<\/strong><\/h2>\n<h3>\ud83d\udccc <strong>Purpose:<\/strong><\/h3>\n<p>Temporarily <strong>removes processes<\/strong> from memory to reduce load (swapping), and <strong>brings them back<\/strong> later.<\/p>\n<table>\n<thead>\n<tr>\n<th>Feature<\/th>\n<th>Details<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Selects<\/td>\n<td>Which process to <strong>suspend\/resume<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Controls<\/td>\n<td><strong>Memory usage<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Frequency<\/td>\n<td>Runs <strong>occasionally<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Involved in<\/td>\n<td>Swapping (Suspend\/Resume)<\/td>\n<\/tr>\n<tr>\n<td>Used in<\/td>\n<td>Time-sharing and multitasking OS<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\ud83d\udfe2 Example:<\/strong> If RAM is full, it swaps a background process to disk.<\/p>\n<hr \/>\n<h2>\ud83d\udcca <strong>Comparison Table<\/strong><\/h2>\n<table>\n<thead>\n<tr>\n<th>Scheduler Type<\/th>\n<th>Controls<\/th>\n<th>Frequency<\/th>\n<th>Queue Movement<\/th>\n<th>Key Role<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Long-Term Scheduler<\/td>\n<td>Degree of multiprogramming<\/td>\n<td>Low (Infrequent)<\/td>\n<td>Job Pool \u2192 Ready Queue<\/td>\n<td>Job selection<\/td>\n<\/tr>\n<tr>\n<td>Short-Term Scheduler<\/td>\n<td>CPU usage<\/td>\n<td>High (Frequent)<\/td>\n<td>Ready Queue \u2192 CPU<\/td>\n<td>Process execution<\/td>\n<\/tr>\n<tr>\n<td>Medium-Term Scheduler<\/td>\n<td>RAM usage<\/td>\n<td>Medium<\/td>\n<td>Memory \u2194 Disk (Swapping)<\/td>\n<td>Load balancing<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h2>\ud83e\udde0 <strong>Memory Tip:<\/strong><\/h2>\n<p><strong>&#8220;Long brings in, Short runs, Medium swaps out.&#8221;<\/strong><\/p>\n<hr \/>\n<h2>\u2705 Summary:<\/h2>\n<ul>\n<li><strong>Long-Term:<\/strong> Decides <strong>who can enter<\/strong> the system.<\/li>\n<li><strong>Short-Term:<\/strong> Decides <strong>who runs<\/strong> on CPU next.<\/li>\n<li><strong>Medium-Term:<\/strong> Decides <strong>who stays or swaps<\/strong> in memory.<\/li>\n<\/ul>\n<hr \/>\n<p>Would you like:<\/p>\n<ul>\n<li>A diagram to visualize all 3 schedulers?<\/li>\n<li>A PDF of notes for revision?<\/li>\n<li>Practice questions on this topic?<\/li>\n<\/ul>\n<p>Let me know!<\/p>\n<h3><a href=\"https:\/\/www.srinix.org\/lecture_notes\/Materials_2020_21\/CSE\/5TH%20SEM\/OS(MOD-2).pdf\" target=\"_blank\" rel=\"noopener\">Day 01 Part 17(A)- Schedulers in operating system long term, short term and midium term schedulers.<\/a><\/h3>\n<h3 class=\"LC20lb MBeuO DKV0Md\"><a href=\"https:\/\/www.idc-online.com\/technical_references\/pdfs\/information_technology\/Types_of_Scheduling.pdf\" target=\"_blank\" rel=\"noopener\">Types Of Scheduling<\/a><\/h3>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Day 01 Part 17(A)- Schedulers in operating system long term, short term and midium term schedulers [fvplayer id=&#8221;333&#8243;] \u00a0Schedulers in Operating System (OS) \u2013 Long-Term, Short-Term &amp; Medium-Term Schedulers Schedulers in an Operating System (OS) are responsible for managing process execution by selecting processes to run in the CPU. There are three types of schedulers: [&hellip;]<\/p>\n","protected":false},"author":66,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[78],"tags":[],"class_list":["post-3282","post","type-post","status-publish","format-standard","hentry","category-operating-system"],"_links":{"self":[{"href":"https:\/\/www.reilsolar.com\/pdf\/wp-json\/wp\/v2\/posts\/3282","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.reilsolar.com\/pdf\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.reilsolar.com\/pdf\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.reilsolar.com\/pdf\/wp-json\/wp\/v2\/users\/66"}],"replies":[{"embeddable":true,"href":"https:\/\/www.reilsolar.com\/pdf\/wp-json\/wp\/v2\/comments?post=3282"}],"version-history":[{"count":0,"href":"https:\/\/www.reilsolar.com\/pdf\/wp-json\/wp\/v2\/posts\/3282\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.reilsolar.com\/pdf\/wp-json\/wp\/v2\/media?parent=3282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.reilsolar.com\/pdf\/wp-json\/wp\/v2\/categories?post=3282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.reilsolar.com\/pdf\/wp-json\/wp\/v2\/tags?post=3282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}