Concurrency in Chromium:
cfredric@
How I learned to stop worrying and love Sequences
Goals
Non-goals:
Agenda
Chromium's Architecture
Intra-process Parallelism (in general)
All threads of a given process share the same address space (modulo thread-local storage [TLS]).
How can threads avoid data races, in general?
Multiple approaches:
Intra-process Parallelism in Chromium
Chromium uses the hybrid approach, with a strong preference for message-passing:
The End
The End
Why not stop here?
Chromium's concurrency vocabulary
How does Chromium execute Sequences?
Why are we here, again?
How to use Sequences safely?
Sequences, visualized
UI
Task
History::GetHistory...
Worker
Task
Task
Worker
Task
History::GetHistory...
Image credit: Life of a Process, Chrome U 2019
Sequence internals
A class that is:
And has:
How does the infra use Sequences?
Who creates Sequences?
How do I send a task from my Sequence to another?
How do I run tasks on "my" Sequence?
I don't know what Sequence I need to run on!
References
Appendix