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
Satoru Takeuchi
PRO
August 23, 2020
640
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
79
Linuxカーネルの インタフェースは変わりうる?
sat
PRO
1
110
あなたの知らないバージョン命名規則
sat
PRO
3
920
Rook: Intro and Deep Dive with Ceph
sat
PRO
1
74
Machine Check Exception
sat
PRO
2
71
バイナリダンプの模様を読む
sat
PRO
0
110
cpコマンドはディスク上でデータを コピーしないことがある
sat
PRO
3
110
114-ファイルのshallow_copy.pdf
sat
PRO
2
63
113-Btrfsのスナップショット.pdf
sat
PRO
0
47
Featured
See All Featured
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
870
Statistics for Hackers
jakevdp
799
230k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
930
Designing for humans not robots
tammielis
254
26k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
30 Presentation Tips
portentint
PRO
1
430
Game over? The fight for quality and originality in the time of robots
wayneb77
1
310
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
500
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.8k
A Soul's Torment
seathinner
8
3.8k
ラッコキーワード サービス紹介資料
rakko
1
5.4M
Discover your Explorer Soul
emna__ayadi
2
1.3k
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