{"id":289,"date":"2018-07-27T08:31:40","date_gmt":"2018-07-27T08:31:40","guid":{"rendered":"http:\/\/csp13.epgpbooks.inflibnet.ac.in\/?post_type=chapter&#038;p=289"},"modified":"2018-07-27T08:40:25","modified_gmt":"2018-07-27T08:40:25","slug":"rtos-scheduling-policies-1","status":"publish","type":"chapter","link":"https:\/\/ebooks.inflibnet.ac.in\/csp13\/chapter\/rtos-scheduling-policies-1\/","title":{"rendered":"RTOS: Scheduling policies-1"},"content":{"raw":"<div>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">In this module, basic concepts of scheduling and types of scheduling policies will be discussed. Context switching and preemption scheduling will also be explained in detail in this module.<\/p>\r\n&nbsp;\r\n\r\n<strong>1.Basic Concepts<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Maximum CPU utilization is obtained with multiprogramming by keeping several processes in memory at one time. Scheduling of the CPU among these processes is one of the fundamental issues in an operating system. The Process execution consists of a cycle of a CPU time burst and an I\/O time burst. When a process executes, it alternates between these two states (i.e., CPU burst and I\/O burst). Each and every time a running process waits, another process can take over the use of the CPU. A CPU scheduler determines which process can take over the use of the CPU.<\/p>\r\n&nbsp;\r\n\r\n<strong>1.1 CPU Scheduler<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">The CPU scheduler selects from among the processes in memory that are ready to execute and allocates the CPU to one of them. The process of choosing the order of running processes is known as scheduling. Scheduling states are given as follows: waiting, ready, or executing.One process must be executing on the CPU at any time. The scheduling by OS is explained in detail in the figure 1.1 shown below.<\/p>\r\n&nbsp;\r\n\r\nThe CPU scheduling is affected by the following set of circumstances:\r\n\r\n&nbsp;\r\n\r\n1. A process switches from the <strong>running<\/strong> to <strong>waiting<\/strong> state.\r\n\r\n&nbsp;\r\n\r\n2. A process switches from the <strong>running<\/strong> to <strong>ready<\/strong> state.\r\n\r\n&nbsp;\r\n\r\n3. A process switches from the <strong>waiting<\/strong> to <strong>ready<\/strong> state.\r\n\r\n&nbsp;\r\n\r\n4. A process switches from the <strong>running<\/strong> to <strong>terminated<\/strong> state.\r\n\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-293 aligncenter\" src=\"http:\/\/csp13.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/62\/2018\/07\/2-164.png\" alt=\"\" width=\"493\" height=\"242\" \/>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Consider that a process is in running state. If an interrupt occurs, it moves to the ready state and if the interrupt process is completed, the scheduler dispatches from the ready state to the running state. If the process is in running state and in requirement of I\/O or needs to wait\u00a0<span style=\"font-size: 1em;text-align: initial\">for an event, the scheduler moves it to the waiting state. Once the I\/O or event are ready\/available, the process is moved to the ready state. Once the process is completed, it is moved to the terminated state.<\/span><\/p>\r\n\r\n<\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n<strong>2. Scheduling policy in RTOS:<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Each task in an embedded application has an infinite loop from start to finish.To achieve efficient CPU utilization a multitasking RTOS uses an orderly transfer of control from one code entity to another. To accomplish this the RTOS must monitor the system resources and the execution state of each code entity, and it must ensure that each entity receives the control of the CPU in a timely manner.The key word here is work in a timely manner.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">A real-time system that does not perform a required operation at the correct time is said to have failed. That failure can have consequences that range from benign to catastrophic. The response time for a request of kernel services and the execution time of these services must be fast and predictable. In an RTOS, the application program code has to be designed to ensure that all its needs are detected and processed. Real-time applications usually consist of several tasks (also can be called processes or threads) that require control of system resources at varying times due to external or internal events. Each task must compete with all other tasks for control of system resources such as memory, execution time, or peripheral devices.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">The developer uses the scheduling models in the RTOS to manage this \u201ccompetition\u201d between the tasks. The program code can be compute-bound (heavily dependent on CPU resources) or I\/O-bound (heavily dependent on access to external devices). Program code that is I\/O bound or compute bound is not allowed to monopolize a system resource if more important tasks requires the same resource.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">Scheduling policies determine how the processes are selected for execution. Scheduling policies can also deliver higher CPU utilization. Right scheduling policies meet all the timing requirements and also properly utilize the CPU.<\/p>\r\n&nbsp;\r\n\r\nSome of the scheduling policies are discussed in detail.\r\n\r\n&nbsp;\r\n\r\n<strong>2.1. Simple Scheduling<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">A very simple scheduling policy is known as cyclo static scheduling or sometimes as Time Division Multiple Access Scheduling. Time Division Multiple Access divides the time into equal-sized time slots over an interval equal to the length of the hyper-period <em>H.<\/em> Processes always run in the same time slot. It is depending on the deadlines for some of the processes. Some time slots will be empty. Since the time slots are of equal size, some short processes may have time left over in their time slot. Utilization is used as a schedulability measure.The total CPU time of all the processes must be less than the hyper-period. An example of Time division multiple access is shown in Figure 1.2. It shows three processes scheduled using TDMA.<\/p>\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-294 aligncenter\" src=\"http:\/\/csp13.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/62\/2018\/07\/2-165.png\" alt=\"\" width=\"496\" height=\"137\" \/>\r\n\r\nAnother scheduling policy that is slightly more sophisticated is round robin. Round robin\u00a0<span style=\"font-size: 1em;text-align: initial\">uses the same hyperperiod as cyclostatic.<\/span>\r\n\r\n<\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n<strong>2.2 Round robin<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Here also, the processes are scheduled in a cyclic fashion. However, if a process does not have any useful work to do, the round-robin scheduler moves on to the next process in order to fill the time slot with useful work.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\"><strong>Example: <\/strong>All three processes execute during the first hyper-period, but during the second one, P1 has no useful work and is skipped. The processes are always executed in the same order and are shown in Figure 1.3.<\/p>\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-295 aligncenter\" src=\"http:\/\/csp13.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/62\/2018\/07\/2-166.png\" alt=\"\" width=\"379\" height=\"127\" \/>\r\n\r\n<strong>2.3.Pre-emptive Scheduling<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Pre-emption is a mechanism to stop a current process and provide service to another process. In a preemptive model, the tasks can be forcibly suspended. This is initiated by an interrupt on the CPU. OS schedules such that the higher priority task, when ready, preempts a lower priority by blocking the current running task. It solves the problem of large worst case latency for higher priority tasks.<\/p>\r\n&nbsp;\r\n\r\nIn the preemptive scheduling model, a task must be in one of four states:\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">\u25cf\u00a0<strong>Running <\/strong>\u2013In this state, the task is in control of the CPU.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">\u25cf<strong>Ready <\/strong>\u2013 In this state, the task is not blocked and is ready to receive control of the CPU when the scheduling policy indicates it is the highest priority task in the system that is not blocked.<\/p>\r\n&nbsp;\r\n\r\nInactive and blocked are the two waiting states.\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">\u25cf\u00a0<strong>Inactive <\/strong>\u2013 In Inactive state, the task is blocked and requires initialization in order to become ready.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">\u25cf\u00a0<strong>Blocked <\/strong>\u2013 In blocked state, the task is waiting for something to happen or for a resource to become available.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">There must be a way of interrupting the operation of the lesser task and granting the resource to the more important one. Then the highest-priority task ready to run is always given control of the CPU. If an ISR makes a higher-priority task ready, the higher-priority task is resumed (instead of the interrupted task). Most commercial real-time kernels are preemptive.<\/p>\r\n\r\n<\/div>\r\n<div>\r\n\r\n<img class=\"size-full wp-image-296 aligncenter\" src=\"http:\/\/csp13.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/62\/2018\/07\/2-167.png\" alt=\"\" width=\"702\" height=\"274\" \/>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Example of pre-emptive scheduling is shown in figure 1.4. In this, each task has a priority relative to all the other tasks. The most critical task is assigned the highest priority. The highest priority task that is ready to run gets control of the processor. A task runs until it yields, terminates, or blocks. Each task has its own memory stack. Before a task can run it must load its context from its memory stack (this can take many cycles). If a task is preempted it must save its current state\/context; this context is restored when the task is given control of the processor. Thus context switch is an important aspect in preemptive scheduling, and is discussed in detail below.<\/p>\r\n&nbsp;\r\n\r\n<em>2.3.1 Why we use Pre-emptive Scheduling<\/em>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">The reason for the use of Pre-emptive scheduling is to reduce the limitations in cooperative and cyclic scheduling of tasks.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\"><strong>Cooperative scheduling: <\/strong>It waits for the running task to get finished and then schedules each ready task. A long execution time of a low- priority task lets a high priority task wait until the low-priority task finishes.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\"><strong>Cyclic scheduling: <\/strong>Assume that the cooperative scheduler is cyclic, without having a predefined time slice. Consider that an interrupt for service occurs from the first task, just at the beginning of the second task. Then the first task service waits till all other remaining listed or queued tasks finish. Worst case latency equals the sum of execution times of all tasks.<\/p>\r\n&nbsp;\r\n\r\n<em>2.3.2 Advantage of Preemptive Scheduler:<\/em>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">The advantage of preemptive scheduler is that, the execution of the highest-priority task is deterministic and the task-level response time will be minimized.<\/p>\r\n&nbsp;\r\n\r\n<em>2.3.3 Disadvantage of Preemptive Scheduler:<\/em>\r\n\r\n&nbsp;\r\n\r\nIt should not use non-reentrant functions unless exclusive access to these functions is ensured.\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n<strong>2.4.Context Switch<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">The set of registers that define a process is known as its context. The switching from one process register set to another register set is known as context switching. The data structure that holds the state of the process is known as the process control block (PCB)<strong><em>.<\/em><\/strong> That is, the context of a process is represented in the PCB. The time it takes is dependent on the\u00a0<span style=\"font-size: 1em;text-align: initial\">hardware support. The context-switch time is overhead, the system won\u2019t do any useful work while switching.<\/span><\/p>\r\n\r\n<\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n<strong>2.4.1 Context Switch between processes<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Context switch between two processes is shown in Figure 1.5 given below. Here the process is first switched from the user space to kernel space while switching between two processes P0 and P1.<\/p>\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-297 aligncenter\" src=\"http:\/\/csp13.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/62\/2018\/07\/2-168.png\" alt=\"\" width=\"608\" height=\"339\" \/>\r\n\r\n<img class=\"size-full wp-image-298 aligncenter\" src=\"http:\/\/csp13.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/62\/2018\/07\/2-169.png\" alt=\"\" width=\"545\" height=\"403\" \/>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Context switch between the processes are shown in figure 1.6. For switching, first the process P0 gives interrupt or system call to save the state into process control Block PCB0. At that time the process P1 is in the idle state. Then the process P0 will enter into reload state of PCB1. Then the process P0 enters into idle state, P1 enters into executing state. After that it transfers the control to process P0 then it goes to save state into PCB1. Then the\u00a0<span style=\"font-size: 1em;text-align: initial\">control is transferred to the reload state of PCB0. Next, the process P0 starts executing.<\/span><\/p>\r\n\r\n<\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n<strong>2.4.2 Time slice mechanism for multitasking<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">On each context switch, a task is selected by the kernel\u2019s scheduler from the \u2018ready\u2019 list and is put into the run state. It is then executed until another context switch occurs. This is normally signaled by a periodic interrupt from a timer. In such cases the task is simply switched out and put back on the \u2018ready\u2019 list, awaiting its next slot. Alternatively, the execution can be stopped by the task executing certain kernel commands. It could suspend itself, where it remains present in the system but no further execution occurs. It could become dormant, awaiting a start command from another task, or even simply waiting for a server task within the operating system to perform a special function for it. The time slice mechanism for multitasking operating system is shown in figure 1.7 below.<\/p>\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-299 aligncenter\" src=\"http:\/\/csp13.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/62\/2018\/07\/2-170.png\" alt=\"\" width=\"435\" height=\"216\" \/>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">The diagram shown below gives a simplified state diagram for a typical real-time operating system which uses this time slice mechanism.<\/p>\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-300 aligncenter\" src=\"http:\/\/csp13.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/62\/2018\/07\/2-171.png\" alt=\"\" width=\"592\" height=\"398\" \/>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">When the context switching occurs, the CPU register contents are stored in task A\u2019s table. Then the next task( task B) is identified and task B\u2019s register contents are loaded into the processor registers. Now the processor starts executing task B.This sequence of operations is illustrated in figure 1.8.<\/p>\r\n\r\n<\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n<em>2.4.2 Steps in Context Switch<\/em>\r\n\r\n&nbsp;\r\n\r\nThe following are the steps to perform context switch.\r\n\r\n&nbsp;\r\n\r\n\u25cf\u00a0\u00a0\u00a0\u00a0 First save context of the processor including program counter and other registers.\r\n\r\n&nbsp;\r\n\r\n\u25cf\u00a0\u00a0\u00a0\u00a0 Update the PCB of the running process with its new state and other associate information.\r\n\r\n&nbsp;\r\n\r\n\u25cf\u00a0\u00a0\u00a0\u00a0 Move PCB to appropriate queue \u2013 ready, blocked.\r\n\r\n&nbsp;\r\n\r\n\u25cf\u00a0\u00a0\u00a0\u00a0 Select another process for execution.\r\n\r\n&nbsp;\r\n\r\n\u25cf\u00a0\u00a0\u00a0\u00a0 Update PCB of the selected process.\r\n\r\n&nbsp;\r\n\r\n\u25cf\u00a0\u00a0\u00a0\u00a0 Restore CPU context from that of the selected process.\r\n\r\n&nbsp;\r\n\r\n<strong>2.4.3 Example of Context Switch<\/strong>\r\n\r\n&nbsp;\r\n\r\nFigure 1.9 shows the situation when context switch occurs in the system during I\/O request.\r\n\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-301 aligncenter\" src=\"http:\/\/csp13.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/62\/2018\/07\/2-172.png\" alt=\"\" width=\"565\" height=\"361\" \/>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Consider that there are three processes P1, P2 and P3. Assume that the process P3 is in running state. Suddenly when an I\/O request is received, the scheduler loads the corresponding device driver, and then switches to process P1. When the time slice of P1 is exceeded, it schedules P2. While P2 is executing, an interrupt (corresponding to the previous I\/O request) occurs. Hence, a context switch occurs and interrupt service routine for I\/O request is executed. After finishing the interrupt service, context switch again occurs to resume the previous process P2.<\/p>\r\n&nbsp;\r\n\r\n<strong>3. Summary<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">In this module scheduling policies have been discussed along with their advantages and limitations. Context Switch is also discussed in detail here.<\/p>\r\n&nbsp;\r\n\r\n<strong>4.\u00a0 <\/strong><strong>References<\/strong>\r\n\r\n<strong>\u00a0<\/strong>\r\n\r\n1.\u00a0\u00a0\u00a0 Galvin and silberschatz, \u201cOperating System Concepts\u201d, New York-Wiley-2012.\r\n\r\n&nbsp;\r\n\r\n2.\u00a0\u00a0\u00a0 Steve heath, \u201cEmbedded Systems Design\u201d, ELSEVIER (second edition) - 2005.\r\n\r\n&nbsp;\r\n\r\n3.\u00a0\u00a0\u00a0 <a href=\"https:\/\/doc.micrium.com\/display\/osiidoc\/Real-Time+Systems+Concepts#Real-TimeSystemsConcepts-PreemptiveKernel\">https:\/\/doc.micrium.com\/display\/osiidoc\/Real-Time+Systems+Concepts#Real-<\/a><a href=\"https:\/\/doc.micrium.com\/display\/osiidoc\/Real-Time+Systems+Concepts#Real-TimeSystemsConcepts-PreemptiveKernel\">TimeSystemsConcepts.<\/a>\r\n\r\n<\/div>\r\n&nbsp;","rendered":"<div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">In this module, basic concepts of scheduling and types of scheduling policies will be discussed. Context switching and preemption scheduling will also be explained in detail in this module.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>1.Basic Concepts<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Maximum CPU utilization is obtained with multiprogramming by keeping several processes in memory at one time. Scheduling of the CPU among these processes is one of the fundamental issues in an operating system. The Process execution consists of a cycle of a CPU time burst and an I\/O time burst. When a process executes, it alternates between these two states (i.e., CPU burst and I\/O burst). Each and every time a running process waits, another process can take over the use of the CPU. A CPU scheduler determines which process can take over the use of the CPU.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>1.1 CPU Scheduler<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">The CPU scheduler selects from among the processes in memory that are ready to execute and allocates the CPU to one of them. The process of choosing the order of running processes is known as scheduling. Scheduling states are given as follows: waiting, ready, or executing.One process must be executing on the CPU at any time. The scheduling by OS is explained in detail in the figure 1.1 shown below.<\/p>\n<p>&nbsp;<\/p>\n<p>The CPU scheduling is affected by the following set of circumstances:<\/p>\n<p>&nbsp;<\/p>\n<p>1. A process switches from the <strong>running<\/strong> to <strong>waiting<\/strong> state.<\/p>\n<p>&nbsp;<\/p>\n<p>2. A process switches from the <strong>running<\/strong> to <strong>ready<\/strong> state.<\/p>\n<p>&nbsp;<\/p>\n<p>3. A process switches from the <strong>waiting<\/strong> to <strong>ready<\/strong> state.<\/p>\n<p>&nbsp;<\/p>\n<p>4. A process switches from the <strong>running<\/strong> to <strong>terminated<\/strong> state.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-293 aligncenter\" src=\"http:\/\/csp13.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/62\/2018\/07\/2-164.png\" alt=\"\" width=\"493\" height=\"242\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-164.png 493w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-164-300x147.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-164-65x32.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-164-225x110.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-164-350x172.png 350w\" sizes=\"auto, (max-width: 493px) 100vw, 493px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Consider that a process is in running state. If an interrupt occurs, it moves to the ready state and if the interrupt process is completed, the scheduler dispatches from the ready state to the running state. If the process is in running state and in requirement of I\/O or needs to wait\u00a0<span style=\"font-size: 1em;text-align: initial\">for an event, the scheduler moves it to the waiting state. Once the I\/O or event are ready\/available, the process is moved to the ready state. Once the process is completed, it is moved to the terminated state.<\/span><\/p>\n<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p><strong>2. Scheduling policy in RTOS:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Each task in an embedded application has an infinite loop from start to finish.To achieve efficient CPU utilization a multitasking RTOS uses an orderly transfer of control from one code entity to another. To accomplish this the RTOS must monitor the system resources and the execution state of each code entity, and it must ensure that each entity receives the control of the CPU in a timely manner.The key word here is work in a timely manner.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">A real-time system that does not perform a required operation at the correct time is said to have failed. That failure can have consequences that range from benign to catastrophic. The response time for a request of kernel services and the execution time of these services must be fast and predictable. In an RTOS, the application program code has to be designed to ensure that all its needs are detected and processed. Real-time applications usually consist of several tasks (also can be called processes or threads) that require control of system resources at varying times due to external or internal events. Each task must compete with all other tasks for control of system resources such as memory, execution time, or peripheral devices.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">The developer uses the scheduling models in the RTOS to manage this \u201ccompetition\u201d between the tasks. The program code can be compute-bound (heavily dependent on CPU resources) or I\/O-bound (heavily dependent on access to external devices). Program code that is I\/O bound or compute bound is not allowed to monopolize a system resource if more important tasks requires the same resource.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Scheduling policies determine how the processes are selected for execution. Scheduling policies can also deliver higher CPU utilization. Right scheduling policies meet all the timing requirements and also properly utilize the CPU.<\/p>\n<p>&nbsp;<\/p>\n<p>Some of the scheduling policies are discussed in detail.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>2.1. Simple Scheduling<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">A very simple scheduling policy is known as cyclo static scheduling or sometimes as Time Division Multiple Access Scheduling. Time Division Multiple Access divides the time into equal-sized time slots over an interval equal to the length of the hyper-period <em>H.<\/em> Processes always run in the same time slot. It is depending on the deadlines for some of the processes. Some time slots will be empty. Since the time slots are of equal size, some short processes may have time left over in their time slot. Utilization is used as a schedulability measure.The total CPU time of all the processes must be less than the hyper-period. An example of Time division multiple access is shown in Figure 1.2. It shows three processes scheduled using TDMA.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-294 aligncenter\" src=\"http:\/\/csp13.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/62\/2018\/07\/2-165.png\" alt=\"\" width=\"496\" height=\"137\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-165.png 496w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-165-300x83.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-165-65x18.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-165-225x62.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-165-350x97.png 350w\" sizes=\"auto, (max-width: 496px) 100vw, 496px\" \/><\/p>\n<p>Another scheduling policy that is slightly more sophisticated is round robin. Round robin\u00a0<span style=\"font-size: 1em;text-align: initial\">uses the same hyperperiod as cyclostatic.<\/span><\/p>\n<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p><strong>2.2 Round robin<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Here also, the processes are scheduled in a cyclic fashion. However, if a process does not have any useful work to do, the round-robin scheduler moves on to the next process in order to fill the time slot with useful work.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><strong>Example: <\/strong>All three processes execute during the first hyper-period, but during the second one, P1 has no useful work and is skipped. The processes are always executed in the same order and are shown in Figure 1.3.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-295 aligncenter\" src=\"http:\/\/csp13.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/62\/2018\/07\/2-166.png\" alt=\"\" width=\"379\" height=\"127\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-166.png 379w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-166-300x101.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-166-65x22.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-166-225x75.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-166-350x117.png 350w\" sizes=\"auto, (max-width: 379px) 100vw, 379px\" \/><\/p>\n<p><strong>2.3.Pre-emptive Scheduling<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Pre-emption is a mechanism to stop a current process and provide service to another process. In a preemptive model, the tasks can be forcibly suspended. This is initiated by an interrupt on the CPU. OS schedules such that the higher priority task, when ready, preempts a lower priority by blocking the current running task. It solves the problem of large worst case latency for higher priority tasks.<\/p>\n<p>&nbsp;<\/p>\n<p>In the preemptive scheduling model, a task must be in one of four states:<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">\u25cf\u00a0<strong>Running <\/strong>\u2013In this state, the task is in control of the CPU.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">\u25cf<strong>Ready <\/strong>\u2013 In this state, the task is not blocked and is ready to receive control of the CPU when the scheduling policy indicates it is the highest priority task in the system that is not blocked.<\/p>\n<p>&nbsp;<\/p>\n<p>Inactive and blocked are the two waiting states.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">\u25cf\u00a0<strong>Inactive <\/strong>\u2013 In Inactive state, the task is blocked and requires initialization in order to become ready.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">\u25cf\u00a0<strong>Blocked <\/strong>\u2013 In blocked state, the task is waiting for something to happen or for a resource to become available.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">There must be a way of interrupting the operation of the lesser task and granting the resource to the more important one. Then the highest-priority task ready to run is always given control of the CPU. If an ISR makes a higher-priority task ready, the higher-priority task is resumed (instead of the interrupted task). Most commercial real-time kernels are preemptive.<\/p>\n<\/div>\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-296 aligncenter\" src=\"http:\/\/csp13.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/62\/2018\/07\/2-167.png\" alt=\"\" width=\"702\" height=\"274\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-167.png 702w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-167-300x117.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-167-65x25.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-167-225x88.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-167-350x137.png 350w\" sizes=\"auto, (max-width: 702px) 100vw, 702px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Example of pre-emptive scheduling is shown in figure 1.4. In this, each task has a priority relative to all the other tasks. The most critical task is assigned the highest priority. The highest priority task that is ready to run gets control of the processor. A task runs until it yields, terminates, or blocks. Each task has its own memory stack. Before a task can run it must load its context from its memory stack (this can take many cycles). If a task is preempted it must save its current state\/context; this context is restored when the task is given control of the processor. Thus context switch is an important aspect in preemptive scheduling, and is discussed in detail below.<\/p>\n<p>&nbsp;<\/p>\n<p><em>2.3.1 Why we use Pre-emptive Scheduling<\/em><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">The reason for the use of Pre-emptive scheduling is to reduce the limitations in cooperative and cyclic scheduling of tasks.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><strong>Cooperative scheduling: <\/strong>It waits for the running task to get finished and then schedules each ready task. A long execution time of a low- priority task lets a high priority task wait until the low-priority task finishes.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><strong>Cyclic scheduling: <\/strong>Assume that the cooperative scheduler is cyclic, without having a predefined time slice. Consider that an interrupt for service occurs from the first task, just at the beginning of the second task. Then the first task service waits till all other remaining listed or queued tasks finish. Worst case latency equals the sum of execution times of all tasks.<\/p>\n<p>&nbsp;<\/p>\n<p><em>2.3.2 Advantage of Preemptive Scheduler:<\/em><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">The advantage of preemptive scheduler is that, the execution of the highest-priority task is deterministic and the task-level response time will be minimized.<\/p>\n<p>&nbsp;<\/p>\n<p><em>2.3.3 Disadvantage of Preemptive Scheduler:<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>It should not use non-reentrant functions unless exclusive access to these functions is ensured.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>2.4.Context Switch<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">The set of registers that define a process is known as its context. The switching from one process register set to another register set is known as context switching. The data structure that holds the state of the process is known as the process control block (PCB)<strong><em>.<\/em><\/strong> That is, the context of a process is represented in the PCB. The time it takes is dependent on the\u00a0<span style=\"font-size: 1em;text-align: initial\">hardware support. The context-switch time is overhead, the system won\u2019t do any useful work while switching.<\/span><\/p>\n<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p><strong>2.4.1 Context Switch between processes<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Context switch between two processes is shown in Figure 1.5 given below. Here the process is first switched from the user space to kernel space while switching between two processes P0 and P1.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-297 aligncenter\" src=\"http:\/\/csp13.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/62\/2018\/07\/2-168.png\" alt=\"\" width=\"608\" height=\"339\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-168.png 608w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-168-300x167.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-168-65x36.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-168-225x125.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-168-350x195.png 350w\" sizes=\"auto, (max-width: 608px) 100vw, 608px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-298 aligncenter\" src=\"http:\/\/csp13.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/62\/2018\/07\/2-169.png\" alt=\"\" width=\"545\" height=\"403\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-169.png 545w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-169-300x222.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-169-65x48.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-169-225x166.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-169-350x259.png 350w\" sizes=\"auto, (max-width: 545px) 100vw, 545px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Context switch between the processes are shown in figure 1.6. For switching, first the process P0 gives interrupt or system call to save the state into process control Block PCB0. At that time the process P1 is in the idle state. Then the process P0 will enter into reload state of PCB1. Then the process P0 enters into idle state, P1 enters into executing state. After that it transfers the control to process P0 then it goes to save state into PCB1. Then the\u00a0<span style=\"font-size: 1em;text-align: initial\">control is transferred to the reload state of PCB0. Next, the process P0 starts executing.<\/span><\/p>\n<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p><strong>2.4.2 Time slice mechanism for multitasking<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">On each context switch, a task is selected by the kernel\u2019s scheduler from the \u2018ready\u2019 list and is put into the run state. It is then executed until another context switch occurs. This is normally signaled by a periodic interrupt from a timer. In such cases the task is simply switched out and put back on the \u2018ready\u2019 list, awaiting its next slot. Alternatively, the execution can be stopped by the task executing certain kernel commands. It could suspend itself, where it remains present in the system but no further execution occurs. It could become dormant, awaiting a start command from another task, or even simply waiting for a server task within the operating system to perform a special function for it. The time slice mechanism for multitasking operating system is shown in figure 1.7 below.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-299 aligncenter\" src=\"http:\/\/csp13.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/62\/2018\/07\/2-170.png\" alt=\"\" width=\"435\" height=\"216\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-170.png 435w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-170-300x149.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-170-65x32.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-170-225x112.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-170-350x174.png 350w\" sizes=\"auto, (max-width: 435px) 100vw, 435px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">The diagram shown below gives a simplified state diagram for a typical real-time operating system which uses this time slice mechanism.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-300 aligncenter\" src=\"http:\/\/csp13.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/62\/2018\/07\/2-171.png\" alt=\"\" width=\"592\" height=\"398\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-171.png 592w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-171-300x202.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-171-65x44.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-171-225x151.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-171-350x235.png 350w\" sizes=\"auto, (max-width: 592px) 100vw, 592px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">When the context switching occurs, the CPU register contents are stored in task A\u2019s table. Then the next task( task B) is identified and task B\u2019s register contents are loaded into the processor registers. Now the processor starts executing task B.This sequence of operations is illustrated in figure 1.8.<\/p>\n<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p><em>2.4.2 Steps in Context Switch<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>The following are the steps to perform context switch.<\/p>\n<p>&nbsp;<\/p>\n<p>\u25cf\u00a0\u00a0\u00a0\u00a0 First save context of the processor including program counter and other registers.<\/p>\n<p>&nbsp;<\/p>\n<p>\u25cf\u00a0\u00a0\u00a0\u00a0 Update the PCB of the running process with its new state and other associate information.<\/p>\n<p>&nbsp;<\/p>\n<p>\u25cf\u00a0\u00a0\u00a0\u00a0 Move PCB to appropriate queue \u2013 ready, blocked.<\/p>\n<p>&nbsp;<\/p>\n<p>\u25cf\u00a0\u00a0\u00a0\u00a0 Select another process for execution.<\/p>\n<p>&nbsp;<\/p>\n<p>\u25cf\u00a0\u00a0\u00a0\u00a0 Update PCB of the selected process.<\/p>\n<p>&nbsp;<\/p>\n<p>\u25cf\u00a0\u00a0\u00a0\u00a0 Restore CPU context from that of the selected process.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>2.4.3 Example of Context Switch<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Figure 1.9 shows the situation when context switch occurs in the system during I\/O request.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-301 aligncenter\" src=\"http:\/\/csp13.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/62\/2018\/07\/2-172.png\" alt=\"\" width=\"565\" height=\"361\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-172.png 565w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-172-300x192.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-172-65x42.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-172-225x144.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-content\/uploads\/sites\/62\/2018\/07\/2-172-350x224.png 350w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Consider that there are three processes P1, P2 and P3. Assume that the process P3 is in running state. Suddenly when an I\/O request is received, the scheduler loads the corresponding device driver, and then switches to process P1. When the time slice of P1 is exceeded, it schedules P2. While P2 is executing, an interrupt (corresponding to the previous I\/O request) occurs. Hence, a context switch occurs and interrupt service routine for I\/O request is executed. After finishing the interrupt service, context switch again occurs to resume the previous process P2.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>3. Summary<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">In this module scheduling policies have been discussed along with their advantages and limitations. Context Switch is also discussed in detail here.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>4.\u00a0 <\/strong><strong>References<\/strong><\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<p>1.\u00a0\u00a0\u00a0 Galvin and silberschatz, \u201cOperating System Concepts\u201d, New York-Wiley-2012.<\/p>\n<p>&nbsp;<\/p>\n<p>2.\u00a0\u00a0\u00a0 Steve heath, \u201cEmbedded Systems Design\u201d, ELSEVIER (second edition) &#8211; 2005.<\/p>\n<p>&nbsp;<\/p>\n<p>3.\u00a0\u00a0\u00a0 <a href=\"https:\/\/doc.micrium.com\/display\/osiidoc\/Real-Time+Systems+Concepts#Real-TimeSystemsConcepts-PreemptiveKernel\">https:\/\/doc.micrium.com\/display\/osiidoc\/Real-Time+Systems+Concepts#Real-<\/a><a href=\"https:\/\/doc.micrium.com\/display\/osiidoc\/Real-Time+Systems+Concepts#Real-TimeSystemsConcepts-PreemptiveKernel\">TimeSystemsConcepts.<\/a><\/p>\n<\/div>\n<p>&nbsp;<\/p>\n","protected":false},"author":2,"menu_order":24,"template":"","meta":{"pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":["dr-k-vani"],"pb_section_license":""},"chapter-type":[],"contributor":[58],"license":[],"class_list":["post-289","chapter","type-chapter","status-publish","hentry","contributor-dr-k-vani"],"part":3,"_links":{"self":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-json\/pressbooks\/v2\/chapters\/289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-json\/wp\/v2\/users\/2"}],"version-history":[{"count":4,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-json\/pressbooks\/v2\/chapters\/289\/revisions"}],"predecessor-version":[{"id":302,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-json\/pressbooks\/v2\/chapters\/289\/revisions\/302"}],"part":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-json\/pressbooks\/v2\/parts\/3"}],"metadata":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-json\/pressbooks\/v2\/chapters\/289\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-json\/wp\/v2\/media?parent=289"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-json\/pressbooks\/v2\/chapter-type?post=289"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-json\/wp\/v2\/contributor?post=289"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp13\/wp-json\/wp\/v2\/license?post=289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}