Skip to Content
LINUX系統程式設計 第二版
book

LINUX系統程式設計 第二版

by Robert Love
December 2013
Intermediate to advanced
496 pages
8h 57m
Chinese
GoTop Information, Inc.
Content preview from LINUX系統程式設計 第二版
進階的行程管理
|
205
這些年來,Linux 核心已獲得越來越好的即時支援,並且提供越來越低的延遲以及更一
致的抖動,而且不會影響系統的效能。這多半是因為改善延遲能夠幫助許多類型的應用
程式,例如桌面和 I/O 密集應用程式,並非只有即時應用程式。會有這樣的改善也可以
歸因於 Linux 在嵌入式和即時系統上的成功。
不幸的是,許多對 Linux 核心所進行的嵌入式和即時修改,僅以特製的 Linux 解決方案
存在著,並未納入主流的正式核心。這些修改中有些可以進一步減少延遲,甚至是提供
硬性即時的行為。接下來只會探討正式的核心介面,以及主流核心的行為。幸運的是,
大部分的即時修改會繼續利用 POSIX 介面。因此,隨後的討論還是跟修改過的系統
有關。
Linux 的排班方針與優先權值
Linux 排班器對於一個行程所採取的動作,取決於該行程的
排班方針
scheduling
policy
),也稱為
排班類型
scheduling class
)。除了預定的一般方針,Linux 還提供了
兩個即時排班方針。我們可以使用來自標頭檔
<sched.h>
的預處理器巨集(preprocessor
macro)來表示每個方針:這些巨集是
SCHED_FIFO
SCHED_RR
以及
SCHED_OTHER
每個行程都會具有一個與友善值無關的
靜態優先權值
static priority
)。對一般應用程
式而言,此優先權值往往是
0
。對即時行程而言,此優先權值的範圍可以從 1 99(包
1 99)。 Linux
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

AGILE學習手冊 | SCRUM、XP、精實和看板方法

AGILE學習手冊 | SCRUM、XP、精實和看板方法

Andrew Stellman, Jennifer Greene
管理Kubernetes

管理Kubernetes

Brendan Burns, Craig Tracey
算法技术手册(原书第2 版)

算法技术手册(原书第2 版)

George T.Heineman, Gary Pollice, Stanley Selkow

Publisher Resources

ISBN: 9789862769812