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
650
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
Transcript
10 slides
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
More Decks by Satoru Takeuchi
See All by Satoru Takeuchi
Btrfsのsnapshotとランダム書き込み
sat
PRO
0
51
ファイルシステムのデフラグ
sat
PRO
1
58
コピーオンライト型ファイルシステムと ランダム書き込み
sat
PRO
2
130
119-多機能ファイルシステムBtrfs_のコピー.pdf
sat
PRO
1
90
Linuxカーネルの インタフェースは変わりうる?
sat
PRO
1
120
あなたの知らないバージョン命名規則
sat
PRO
3
940
Rook: Intro and Deep Dive with Ceph
sat
PRO
1
87
Machine Check Exception
sat
PRO
2
78
バイナリダンプの模様を読む
sat
PRO
0
120
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
RailsConf 2023
tenderlove
30
1.6k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
380
Reality Check: Gamification 10 Years Later
codingconduct
0
2.4k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k
Darren the Foodie - Storyboard
khoart
PRO
5
4.1k
Testing 201, or: Great Expectations
jmmastey
46
8.4k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2.1k
Git: the NoSQL Database
bkeepers
PRO
433
67k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
630
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.2k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k