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
Go Scheduler
Search
Cyril Lashkevich
July 21, 2017
Technology
650
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Go Scheduler
GoWayFest 2017
Cyril Lashkevich
July 21, 2017
More Decks by Cyril Lashkevich
See All by Cyril Lashkevich
Bitcode in Swift
notorca
0
85
Mobile Optimized 2014
notorca
1
290
Fun with blocks in ObjC
notorca
1
120
CocoaHeads in Grodno, Lighting
notorca
0
100
Dictionary in Python
notorca
0
150
Foundation data structures
notorca
0
170
iOS memory management
notorca
0
140
NSProxy, multithreading, messaging
notorca
1
120
Python impergections
notorca
0
110
Other Decks in Technology
See All in Technology
AIエージェント時代、Kaggleにどう取り組むか
takanao
1
200
生成AI時代、PMは事業責任者に進化するともっと面白い〜PMだからこそ事業構造を動かせる時代に〜
kakehashi
PRO
0
880
AWS DevOps Agentはどこまで任せられるか 〜機能の現在地と、機能拡張の実践〜
nyankotaro
0
250
日本AIベンチャーレポート2026
kentarofujii
0
240
撮るだけでは終わらない。ソニーが挑むB2Bカメラソリューション開発
sony
0
110
自宅サーバと脆弱性
masakiokuda
1
120
VLA-JEPA: Enhancing Vision-Language-Action Models with Latent World Models
takmin
0
330
ドメインエキスパートは いかにして AI を使って プロダクト開発をするか
tatsuyashiraishi
1
200
AIで選択肢が広がった組織設計の理想と現実
konifar
14
5.8k
Vue.jsのGitHubから学ぶ意思決定
yut0naga1_fa
1
290
ポケモン対戦を自動で記録して振り返ろう
fufufukakaka
0
410
AIコーディングを実践してきた1年を振り返る / Looking Back on a Year of Practicing AI Coding
takedatakashi
1
140
Featured
See All Featured
Faster Mobile Websites
deanohume
310
32k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
490
Skip the Path - Find Your Career Trail
mkilby
1
260
Large-scale JavaScript Application Architecture
addyosmani
516
110k
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
880
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
720
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
230
Transcript
Go Scheduler Cyril Lashkevich GoWayFest 2017
Планировщик главное отличие go от современных mainstream языков В остальном
это Pascal c GC
func main() { var x int threads := runtime.GOMAXPROCS(0) for
i := 0; i < threads; i++ { go func() { for { x++ } }() } time.Sleep(time.Second) fmt.Println("x =", x) }
func test() { a := 100 for i := 1;
i < 1000; i++ { a = i*100/i + a } } func main() { runtime.GOMAXPROCS(1) go func() { for { test() } }() time.Sleep(100 * time.Millisecond) fmt.Println("hello world") }
runtime: tight loops should be preemptible #10958 aclements opened this
issue on May 26, 2015 · 50 comments
Конкурентность и языки Язык Отображение на системные потоки Lua none
C, C++, Python 1:1 Java <= 1.1, j2me, Python n:1 Go, Erlang n:m
Goroutines VS threads Свойство Goroutines Threads Время создания Быстро Медленно
Время удаления Быстро Медленно Переключение контекста Быстро Медленно Потребление памяти под стек 2kB 512kB-1MB Допустимое количество 10^4 10^6
Вытесняющая и кооперативная многозадачность
Планировщики — Work Sharing при появлении новой задачи попытаться мигрировать
ее на свободный процессор — Work Stealing когда процессор освобождается, он пытается найти себе задачу
Scheduling Multithreaded Computations by Work Stealing
G M P — G - Goroutine — M -
OS thread — P - "Processor"
None
None
None
None
GOMAXPROCS Просто количество P
Spining threads — M с P ищет G — M
без P ищет P — Есть готовая к исполнению G, свободная P, но нет M
None
Когда происходит переключение goroutines — morestack() --> newstack() — runtime.Gosched()
— locks — network I/O — syscalls
GOEXPERIMENT = preemptibleloops
Влияние на GC GC не может работать пока есть невытесняемая
goroutine
https://morsmachine.dk/go-scheduler https://rakyll.org/scheduler/ https://github.com/golang/go/blob/master/src/runtime/ proc.go https://docs.google.com/document/d/ 1TTj4T2JO42uD5ID9e89oa0sLKhJYD0Y_kqxDv3I3XMw https://github.com/golang/go/issues/10958 https://github.com/golang/go/issues/16051 https://github.com/golang/go/issues/17831 https://www.slideshare.net/matthewrdale/demystifying-
the-go-scheduler https://povilasv.me/go-scheduler/