Share to: share facebook share twitter share wa share telegram print page

Preemption (computing)

In computing, preemption is the act of temporarily interrupting an executing task, with the intention of resuming it at a later time. This interrupt is done by an external scheduler with no assistance or cooperation from the task.[1]: 153  This preemptive scheduler usually runs in the most privileged protection ring, meaning that interruption and then resumption are considered highly secure actions. Such changes to the currently executing task of a processor are known as context switching.

User mode and kernel mode

In any given system design, some operations performed by the system may not be preemptable. This usually applies to kernel functions and service interrupts which, if not permitted to run to completion, would tend to produce race conditions resulting in deadlock. Barring the scheduler from preempting tasks while they are processing kernel functions simplifies the kernel design at the expense of system responsiveness. The distinction between user mode and kernel mode, which determines privilege level within the system, may also be used to distinguish whether a task is currently preemptable.

Most modern operating systems have preemptive kernels, which are designed to permit tasks to be preempted even when in kernel mode. Examples of such operating systems are Solaris 2.0/SunOS 5.0,[2] Windows NT, Linux kernel (2.5.4 and newer),[3] AIX and some BSD systems (NetBSD, since version 5).

Preemptive multitasking

The term preemptive multitasking is used to distinguish a multitasking operating system, which permits preemption of tasks, from a cooperative multitasking system wherein processes or tasks must be explicitly programmed to yield when they do not need system resources.

In simple terms: Preemptive multitasking involves the use of an interrupt mechanism which suspends the currently executing process and invokes a scheduler to determine which process should execute next. Therefore, all processes will get some amount of CPU time at any given time.

In preemptive multitasking, the operating system kernel can also initiate a context switch to satisfy the scheduling policy's priority constraint, thus preempting the active task. In general, preemption means "prior seizure of". When the high-priority task at that instance seizes the currently running task, it is known as preemptive scheduling.

The term "preemptive multitasking" is sometimes mistakenly used when the intended meaning is more specific, referring instead to the class of scheduling policies known as time-shared scheduling, or time-sharing.

Preemptive multitasking allows the computer system to more reliably guarantee each process a regular "slice" of operating time. It also allows the system to rapidly deal with important external events like incoming data, which might require the immediate attention of one or another process.

At any specific time, processes can be grouped into two categories: those that are waiting for input or output (called "I/O bound"), and those that are fully utilizing the CPU ("CPU bound"). In early systems, processes would often "poll" or "busy-wait" while waiting for requested input (such as disk, keyboard or network input). During this time, the process was not performing useful work, but still maintained complete control of the CPU. With the advent of interrupts and preemptive multitasking, these I/O bound processes could be "blocked", or put on hold, pending the arrival of the necessary data, allowing other processes to utilize the CPU. As the arrival of the requested data would generate an interrupt, blocked processes could be guaranteed a timely return to execution.

Although multitasking techniques were originally developed to allow multiple users to share a single machine, it became apparent that multitasking was useful regardless of the number of users. Many operating systems, from mainframes down to single-user personal computers and no-user control systems (like those in robotic spacecraft), have recognized the usefulness of multitasking support for a variety of reasons. Multitasking makes it possible for a single user to run multiple applications at the same time, or to run "background" processes while retaining control of the computer.

Time slice

The period of time for which a process is allowed to run in a preemptive multitasking system is generally called the time slice or quantum.[1]: 158  The scheduler is run once every time slice to choose the next process to run. The length of each time slice can be critical to balancing system performance vs process responsiveness - if the time slice is too short then the scheduler will consume too much processing time, but if the time slice is too long, processes will take longer to respond to input.

An interrupt is scheduled to allow the operating system kernel to switch between processes when their time slices expire, effectively allowing the processor's time to be shared among a number of tasks, giving the illusion that it is dealing with these tasks in parallel (simultaneously). The operating system which controls such a design is called a multi-tasking system.

System support

Today, nearly all operating systems support preemptive multitasking, including the current versions of Windows, macOS, Linux (including Android), iOS and iPadOS.

An early microcomputer operating system providing preemptive multitasking was Microware's OS-9, available for computers based on the Motorola 6809, including home computers such as the TRS-80 Color Computer 2 when configured with disk drives,[4] with the operating system supplied by Tandy as an upgrade.[5] Sinclair QDOS[6]: 18 and AmigaOS on the Amiga were also microcomputer operating systems offering preemptive multitasking as a core feature. These both ran on Motorola 68000-family microprocessors without memory management. Amiga OS used dynamic loading of relocatable code blocks ("hunks" in Amiga jargon) to multitask preemptively all processes in the same flat address space.

Early operating systems for IBM PC compatibles such as MS-DOS and PC DOS, did not support multitasking at all, however alternative operating systems such as MP/M-86 (1981) and Concurrent CP/M-86 did support preemptive multitasking. Other Unix-like systems including MINIX and Coherent provided preemptive multitasking on 1980s-era personal computers.

Later MS-DOS compatible systems natively supporting preemptive multitasking/multithreading include Concurrent DOS, Multiuser DOS, Novell DOS (later called Caldera OpenDOS and DR-DOS 7.02 and higher). Since Concurrent DOS 386, they could also run multiple DOS programs concurrently in virtual DOS machines.

The earliest version of Windows to support a limited form of preemptive multitasking was Windows/386 2.0, which used the Intel 80386's Virtual 8086 mode to run DOS applications in virtual 8086 machines, commonly known as "DOS boxes", which could be preempted. In Windows 95, 98 and Me, 32-bit applications were made preemptive by running each one in a separate address space, but 16-bit applications remained cooperative for backward compatibility.[7] In Windows 3.1x (protected mode), the kernel and virtual device drivers ran preemptively, but all 16-bit applications were non-preemptive and shared the same address space.

Preemptive multitasking has always been supported by Windows NT (all versions), OS/2 (native applications), Unix and Unix-like systems (such as Linux, BSD and macOS), VMS, OS/360, and many other operating systems designed for use in the academic and medium-to-large business markets.

Although there were plans to upgrade the cooperative multitasking found in the classic Mac OS to a preemptive model (and a preemptive API did exist in Mac OS 9, although in a limited sense[8]), these were abandoned in favor of Mac OS X (now called macOS) that, as a hybrid of the old Mac System style and NeXTSTEP, is an operating system based on the Mach kernel and derived in part from BSD, which had always provided Unix-like preemptive multitasking.

See also

References

  1. ^ a b Tanenbaum, Andrew (2015). Modern operating systems. Boston: Pearson. ISBN 978-0-13-359162-0. OCLC 870646449.
  2. ^ Khanna, S.; Sebree, M.; Zolnovsky, J. "Realtime scheduling in SunOS 5.0". Proceedings of the USENIX Winter Conference, 1992: 375–390.
  3. ^ "Release notes for v2.5.4". The Linux Kernel Archives. Linux Kernel Organization, Inc. Retrieved 2021-07-03.
  4. ^ Downard, Dan (September 1983). "Dynamic Uno". The Rainbow. pp. 236–240. Retrieved 9 May 2024.
  5. ^ 1984 TRS-80 Catalog. Tandy Corporation. 1984. pp. 53–54. Retrieved 14 May 2024.
  6. ^ Pennell, Andrew (1985). The Sinclair QDOS Companion. Sunshine Books. Retrieved 12 May 2024.
  7. ^ "How 16-Bit and 32-Bit Programs Multitask in Windows 95 (Q117567)". Archived from the original on 2008-01-17. Retrieved 2008-01-17.
  8. ^ "Re: newbie question: What is a Blue Task". Archived from the original on 2007-10-13. Retrieved 2007-03-29.

Baca informasi lainnya yang berhubungan dengan : article

Article 19 Article 20

Read other articles:

1991 single by Mariah Carey For songs with similar names, see Can't Let Go. Can't Let GoUS retail cassette variant of the standard worldwide artworkSingle by Mariah Careyfrom the album Emotions B-sideTo Be Around YouSo BlessedReleasedOctober 23, 1991 (1991-10-23)StudioThe Plant Recording Studios (Sausalito, California)GenreR&BsoulLength4:27LabelColumbiaSongwriter(s)Mariah CareyWalter AfanasieffProducer(s)Mariah CareyWalter AfanasieffMariah Carey singles chronology Emotions (19…

Feria de Madrid Mural de la estaciónUbicaciónCoordenadas 40°27′50″N 3°36′58″O / 40.4639, -3.61616Dirección Avenida del Partenón con Avenida Capital de España, MadridDistrito BarajasMunicipio MadridZona Datos de la estaciónNombre anterior Campo de las Naciones (desde su inauguración en 1998 hasta verano de 2017)Accesibilidad SíInauguración 24 de junio de 1998Servicios N.º de andenes 1 centralN.º de vías 2Propietario Consorcio Regional de Transportes de Madrid…

Schloss Weinberg oberhalb von Romenschwanden, Gemeinde St. Margrethen Schloss Weinberg von Westen (links im Hintergrund der Bodensee) Das Schloss Weinberg ist ein mindestens aus dem 15. Jahrhundert stammendes und in den 1980er Jahren zum Schloss umgebautes Gutshaus, heute Sitz eines Weinguts, auf dem Gebiet der politischen Gemeinde St. Margrethen im Kanton St. Gallen, Schweiz. Inhaltsverzeichnis 1 Die Anlage 2 Geschichte 3 Weinbau 3.1 Vorgeschichte 3.2 Seit 1980 4 Literatur 5 Weblinks 6 Fussnote…

The Ducal Palace in Mantua, where L'Orfeo was premiered in 1607 The Italian composer Claudio Monteverdi (1567–1643) wrote several works for the stage between 1604 and 1643, including ten in the then-emerging opera genre. Of these, both the music and libretto for three are extant: L'Orfeo (1607), Il ritorno d'Ulisse in patria (1640) and L'incoronazione di Poppea (1643). Seven other opera projects are known; four were completed and performed during Monteverdi's lifetime, while he abandoned anoth…

600 ← 700 → 701 MontevideoTerminal Baltasar Brum El Pinar por (Aeropuerto de Carrasco)Área abastecidaMunicipios Montevideo / Ciudad de la CostaDescripciónTipo ÓmnibusSistema Sistema de Transporte MetropolitanoOperaciónLongitud Duración del viaje: 1 hora y 15 minutosExplotaciónOperador COPSA [editar datos en Wikidata] La línea 700 es una línea de transporte metropolitano, une Montevideo con el barrio el Pinar de la Ciudad de la Costa. Su punto de partida es desde el Pinar, h…

Barreiras do Piauí   Município do Brasil   Hino Gentílico barreirense Localização Localização de Barreiras do Piauí no PiauíLocalização de Barreiras do Piauí no Piauí Barreiras do PiauíLocalização de Barreiras do Piauí no Brasil Mapa de Barreiras do Piauí Coordenadas 9° 55' 30 S 45° 28' 30 O País Brasil Unidade federativa Piauí Municípios limítrofes Gilbués, São Gonçalo do Gurguéia, Formosa do Rio Preto (BA), Mateiros (TO) e Alto Pa…

Івниця Коростенська дирекція Південно-Західна залізниця зупинний пункт Пасажирський павільйонРозташуванняРозташування с.ІвницяКоординати 50°08′12″ пн. ш. 29°02′21″ сх. д. / 50.1369000000277723° пн. ш. 29.03920000002777968° сх. д. / 50.1369000000277723; 29.03920000002777968Координ…

American professional basketball player Krystal ThomasThomas in 2018Personal informationBorn (1989-06-10) June 10, 1989 (age 34)Orlando, Florida, U.S.Listed height6 ft 5 in (1.96 m)Listed weight210 lb (95 kg)Career informationHigh schoolThe First Academy(Orlando, Florida)CollegeDuke (2007–2011)WNBA draft2011: 3rd round, 36th overall pickSelected by the Seattle StormPlaying career2011–2018PositionCenterCareer history2011Seattle Storm2011–2013Phoenix Mercury2011…

Hôpital pour Enfants des familles Bersohn et Bauman L’Hôpital pour enfants des familles Bersohn et Bauman est un hôpital juif, disparu aujourd’hui, qui a fonctionné dans les années 1878-1942 à Varsovie dans la rue Śliska 51/Sienna 60. En 1941, une filiale de l’hôpital a été construite dans la rue Leszno 80/82. Après la liquidation du « petit ghetto » en août 1942, l’hôpital a été transféré à l’Umschlagplatz, au bâtiment 6/8 dans la rue Stawki. Historique …

2011 album by T-Pain RevolverStudio album by T-PainReleasedDecember 6, 2011 (2011-12-06)Recorded2009–11Genre R&B hip hop electropop Length52:53LabelNappy BoyKonvictRCAProducer Rocco Did It Again! (exec.) Michael Blumstein (exec.) T-Pain (also exec.) Young Fyre Detail Chuckie Greg Kurstin John Shanks T-Minus Billboard Tha Bizness Dr. Luke Cirkut Fabian Lenssen Catalyst Get Cool David Preach Balfour T-Pain chronology prEVOLVEr(2011) Revolver(2011) Stoic(2012) Singles f…

Hongkongese national badminton team Hong KongAssociationHong Kong Badminton AssociationPresidentTong Yun KaiBWF rankingCurrent ranking20 10 (3 January 2023)Highest ranking9 (7 July 2014)Sudirman CupAppearances16 (first in 1989)Best resultGroup stageThomas CupAppearances5 (first in 1996)Best resultQuarter-finals (2016)Uber CupAppearances8 (first in 1996)Best resultSemi-finals (2002)Asian Mixed Team ChampionshipsAppearances3 (first in 2017)Best resultSemi-finals (2019)Asian Men's Team Championship…

يو-2342   الجنسية  ألمانيا النازية الشركة الصانعة دويتشه ويرفت[1]  المالك  كريغسمارينه المشغل كريغسمارينه (1 نوفمبر 1944–26 ديسمبر 1944)[1]  المشغلون الحاليون وسيط property غير متوفر. المشغلون السابقون وسيط property غير متوفر. التكلفة وسيط property غير متوفر. منظومة التعاريف…

List of events ← 1844 1843 1842 1845 in New Zealand → 1846 1847 1848 Decades: 1820s 1830s 1840s 1850s 1860s See also: History of New Zealand List of years in New Zealand Timeline of New Zealand history The following lists events that happened during 1845 in New Zealand. Population The estimated population of New Zealand at the end of 1845 is 72,500 Māori and 12,774 non-Māori.[1] Incumbents Regal and viceregal Head of State – Queen Victoria Governor – Captain Robert Fitz…

Queen of Navarre Joan IIBust in the Louvre, originally from the Jacobin convent which housed Joan's heartQueen of Navarrewith Philip III (1328-1343)Reign1 April 1328 – 6 October 1349Coronation5 March 1329 (Pamplona)PredecessorCharles ISuccessorCharles IIBorn28 January 1312Died6 October 1349(1349-10-06) (aged 37)NavarreSpousePhilip III, King of NavarreIssue Maria, Queen of Aragon Blanche, Queen of France Charles II, King of Navarre Agnes, Countess of Foix Philip, Count of Longueville Louis…

Brasileirão CBFA 2022 Dados Participantes 39 Organização CBFA Período 7 de maio - 27 de novembro Campeão Coritiba Crocodiles Vice-campeão Galo FA ◄◄2019 2023►► O Brasileirão CBFA 2022 foi a primeira edição do Brasileirão de Futebol Americano correspondente às primeira e segunda divisões nacional. Após dois anos de paralisação por conta da Pandemia de Covid-19. Foi a primeira edição após o fim da parceria na qual, do período de 2017 à 2019, a Liga Brasil Futebol Americ…

Japanese manga by Toshiya Wakabayashi Tsuredure ChildrenThe cover of the first volume featuring Saki Kanda (left) and Haruhiko Takase (right) from the first chapter徒然チルドレン(Tsurezure Chirudoren)GenreRomantic comedy[1] MangaWritten byToshiya WakabayashiPublished byKodanshaEnglish publisherNA: Kodansha USAMagazineBessatsu Shōnen Magazine(August 9, 2014 – March 9, 2015)Weekly Shōnen Magazine(April 15, 2015 – July 11, 2018)DemographicShōnenOriginal runAugust 9, …

Defunct American home video company Vestron VideoVestron Video logo, used from 1986 to 1993IndustryHome video companyFounded1981; 42 years ago (1981) (Original)2016; 7 years ago (2016) (Revival)FounderAustin Owen Furst Jr.Defunct1993; 30 years ago (1993) (Original)FateParent company filed for Chapter 11 bankruptcy, assets acquired by LIVE EntertainmentHeadquartersStamford, ConnecticutKey peopleAustin Owen Furst Jr.ParentVestron, Inc. (1981–…

This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages) This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Nomothetic – news · newspapers · books · scholar · JSTOR (September 2009) (Learn how and when to remove this t…

Zoo in Doonside, New South Wales, Australia Featherdale Wildlife ParkYellow-footed rock-wallaby at Featherdale Wildlife Park33°45′58″S 150°53′03″E / 33.76611°S 150.88417°E / -33.76611; 150.88417Date opened1972; 51 years ago (1972)LocationDoonside, New South Wales, AustraliaMajor exhibitsMammalsBirdsWildlifeReptilesMarsupialsWebsitewww.featherdale.com.au Featherdale Wildlife Park is a zoo located in Doonside, Sydney, Australia. The park is loc…

Phản ứng Wittig là phản ứng giữa phosphoran hay phosphonium ylide với aldehyde hay ketone thu được alkene và triphenylphosphine oxid.[1][2] Phản ứng có thể xảy ra trong môi trường ẩm với sự hiện diện của chất xúc tác chuyển pha(PTC- Phase Transfer Catalysis). Tuy nhiên, ở phản ứng dùng xúc tác chuyển pha này có hạn chế ở chỗ chỉ dùng cho aldehyde. Không alkene nào được tổng hợp từ ketone. Đây …

Kembali kehalaman sebelumnya