Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Linuxのプロセススケジューラのしくみ その1 時分割によるスケジューリング
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Satoru Takeuchi
PRO
August 23, 2020
630
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Linuxのプロセススケジューラのしくみ その1 時分割によるスケジューリング
以下動画のテキストです。
https://youtu.be/b924MxEt42Q
Satoru Takeuchi
PRO
August 23, 2020
More Decks by Satoru Takeuchi
See All by Satoru Takeuchi
119-多機能ファイルシステムBtrfs_のコピー.pdf
sat
PRO
1
68
Linuxカーネルの インタフェースは変わりうる?
sat
PRO
1
93
あなたの知らないバージョン命名規則
sat
PRO
3
900
Rook: Intro and Deep Dive with Ceph
sat
PRO
1
64
Machine Check Exception
sat
PRO
2
66
バイナリダンプの模様を読む
sat
PRO
0
89
cpコマンドはディスク上でデータを コピーしないことがある
sat
PRO
3
88
114-ファイルのshallow_copy.pdf
sat
PRO
2
57
113-Btrfsのスナップショット.pdf
sat
PRO
0
40
Featured
See All Featured
Abbi's Birthday
coloredviolet
4
10k
The Cost Of JavaScript in 2023
addyosmani
55
10k
GitHub's CSS Performance
jonrohan
1033
470k
A Modern Web Designer's Workflow
chriscoyier
699
190k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.1k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
510
Heart Work Chapter 1 - Part 1
lfama
PRO
10
36k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.7k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
320
How to train your dragon (web standard)
notwaldorf
97
6.8k
Transcript
Linuxのプロセススケジューラのしくみ その1: 時分割によるスケジューリング Aug 23th, 2020 Satoru Takeuchi Twitter: satoru_takeuchi,
EnSatoru 1
Linuxのプロセススケジューリング • 1つのCPU上で実行可能プロセスが複数個あれば所定の時間づつ実行させる ◦ いわゆる時分割によるスケジューリング ◦ この「所定の時間」を「タイムスライス」と呼ぶ CPU上で動作 するプロセス n=1
n=2 n=3 同上 同上 P0 P0 P1 P0 P0 P1 P2 P0 P1 2 時間
実験 • 目的 ◦ Linuxのスケジューラが時分割によるスケジューリングをしていることを確かめる • 実験プログラムsched.cの概要 1. 1つのCPU上で無限ループするプログラムを 1~4個同時に100ミリ秒間動かす
2. 各プログラムはCPUを1ミリ秒使うごとに次の情報を記録する ▪ プロセスの番号 ▪ プログラム開始時からの経過時間を記録 3. 100ミリ秒経過後に全プログラムについての記録を出力 3
sched.cの動作イメージ(n=2, タイムスライス=2ミリ秒) P0 P1 P0 P1 経過時間(ミリ秒) 0 2 1
3 5 4 6 8 7 記録 記録 記録 記録 記録 記録 記録 記録 測定終了 図示 経過時間(ミリ秒) 4 P1 P0 0 1 2 3 4 5 6 7 8 1ミリ秒の精度では 順番に実行している プロセス 経過時間 P0 1,2,5,6 P1 3,4,7,8
結果(n=1) • p0が動き続ける 5 0
結果(n=2) • P0とP1がおおよそ同じ時間づつ交互に動く 6 0 1 タイムスライス
結果(n=3) • P0~P2がおおよそ均等な時間づつ動作 7 0 1 2
結果(n=4) • P0~P3がおおよそ均等な時間づつ動作 8 0 1 2 3
疑問 • nが増えるとタイムスライスが短くなってるような…? 9 0 1 0 1 2 0
1 2 3
今回はここまで • まとめ ◦ Linuxのスケジューラは時分割式 ◦ 実際にそうなっていることを実験で確認した • 「Linuxのプロセススケジューラのしくみ」次回予告 ◦
タイムスライスはどう決まるのか 10