28 Nisan 2020 Salı

Pre-emptive Scheduling Nedir?

Giriş
Çalışan uygulamayı yarıda kesme işlemine Pre-emptive multitasking deniyor. Türkçesi ise sanırım Geçişli Çoklu Görev olarak kullanılıyor. Linux'a mahsus açıklama şöyle.
... so Linux uses pre-emptive scheduling. In this scheme, each process is allowed to run for a small amount of time, 200ms, and, when this time has expired another process is selected to run and the original process is made to wait for a little while until it can run again. This small amount of time is known as a time-slice.
Pre-emptive Scheduling İçin CPU Interrupt Kullanılır
Açıklaması şöyle.
All practical approaches to preemption will use some sort of CPU interrupt to jump back into privileged mode, i.e. the linux kernel scheduler.

If you look at your /proc/interrupts you'll find the interrupts used in the system, including timers.
Sistem Çağrısı Olunca
Sistem çağrısı olunca aslında bu çağrı bir şekilde scheduler'ı tetikler. Açıklaması şöyle.
I understand that processes jump to syscalls and those jump back to the scheduler, so it makes sense how processes can be “swapped” in that regards
Bir başka açıklama şöyle.
Also, when a program issues a system call (Usually by a software interrupt - "trap"), the kernel is also able to preempt the calling program, this is especially evident with system calls waiting for data from other processes.


Hiç yorum yok:

Yorum Gönder