Seastar (C++ Async Framework)
It is a C++ framework for building server to handle huge load.
Invented in 2010. In 2015 ScyllaDB started using it
Architecture
Multicore
Asynchronous
Shared nothing
Thread-per-Core (Shared-Nothing) <<<<<
This makes it Ultra Fast
1 thread is allocated per CPU core. if system 10 physical CPU
cores, seastar will start with 10 threads. Each thread binded(CPU
affinity) to each core
Each CPU core acts as an isolated, self-contained server with its
own
RAM
network queue
disk etc.
This makes threads not to share memory with each other. Hence
OS locking, context switching, IPC is completely skipped
making it super fast.
Code
#include <seastar/core/app-template.hh>
#include <iostream>
int main(int argc, char** argv) {
seastar::app_template app;
return app.run(argc, argv, [] {
std::cout << "Hello from Seastar!" << std::endl;
return seastar::make_ready_future<>();
});
}