Asynchronous Programming with Seastar
Nadav Har’El - nyh@ScyllaDB.com
Avi Kivity - avi@ScyllaDB.com
1
Introduction
1.1
Asynchronous programming
1.2
Seastar
1.3
Comparison with other asynchronous programming frameworks
1.4
A taste of 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
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
9
Fibers
10
Semaphores
10.1
Limiting parallelism with semaphores
10.2
Limiting resource use
10.3
Limiting parallelism of loops
11
Pipes
12
Shutting down a service with a gate
13
Discarding futures, redux
14
Introducing shared-nothing programming
15
More about Seastar’s event loop
16
Introducing Seastar’s network stack
17
Sharded services
18
File I/O
19
Shutting down cleanly
20
Command line options
20.1
Standard Seastar 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
23.3
Smart pointers
23.4
Out of memory
24
RPC
25
More about the sharded network stack
26
Seastar::thread
26.1
Starting and ending a seastar::thread
27
Streams
28
SIGINT handling
29
Isolation of application components
29.1
Scheduling groups (CPU scheduler)
29.2
Latency