Asynchronous Programming with Seastar
Nadav Har’El - nyh@ScyllaDB.com
Avi Kivity - avi@ScyllaDB.com
1
Introduction
1.1
Asynchronous programming
1.2
Seastar
2
Getting started
3
Threads and memory
3.1
Seastar threads
3.2
Seastar memory
4
Introducing futures and continuations
4.1
Ready futures
5
Continuations
5.1
Capturing state in continuations
5.2
Evaluation order considerations (C++14 only)
5.3
Chaining continuations
6
Handling exceptions
6.1
Exceptions vs. exceptional futures
7
Lifetime management
7.1
Passing ownership to continuation
7.2
Keeping ownership at the caller
7.3
Sharing ownership (reference counting)
7.4
Saving objects on the stack
8
Advanced futures
8.1
Futures and interruption
8.2
Futures are single use
9
Fibers
10
Loops
10.1
repeat
10.2
do_until
10.3
do_for_each
10.4
parallel_for_each
10.5
max_concurrent_for_each
11
when_all: Waiting for multiple futures
12
Semaphores
12.1
Limiting parallelism with semaphores
12.2
Limiting resource use
12.3
Limiting parallelism of loops
13
Pipes
14
Shutting down a service with a gate
15
Introducing shared-nothing programming
16
More about Seastar’s event loop
17
Introducing Seastar’s network stack
18
Sharded services
19
Shutting down cleanly
20
Command line options
20.1
Standard Seastar command-line options
20.2
User-defined command-line options
21
Debugging a Seastar program
21.1
Debugging ignored exceptions
21.2
Finding where an exception was thrown
21.3
Debugging with gdb
22
Promise objects
23
Memory allocation in Seastar
23.1
Per-thread memory allocation
23.2
Foreign pointers
24
Seastar::thread
24.1
Starting and ending a seastar::thread
25
Isolation of application components
25.1
Scheduling groups (CPU scheduler)
25.2
Latency
25.3
Disk I/O scheduler
25.4
Network scheduler
25.5
Controllers
25.6
Multi-tenancy