Wojciech Mitros
2fd6d495fa
wasm: move compilation to an alien thread
...
The compilation of wasm UDFs is performed by a call to a foreign
function, which cannot be divided with yielding points and, as a
result, causes long reactor stalls for big UDFs.
We avoid them by submitting the compilation task to a non-seastar
std::thread, and retrieving the result using seastar::alien.
The thread is created at the start of the program. It executes
tasks from a queue in an infinite loop.
All seastar shards reference the thread through a std::shared_ptr
to a `alien_thread_runner`.
Considering that the compilation takes a long time anyway, the
alien_thread_runner is implemented with focus on simplicity more
than on performance. The tasks are stored in an std::queue, reading
and writing to it is synchronized using an std::mutex for reading/
writing to the queue, and an std::condition_variable waiting until
the queue has elements.
When the destructor of the alien runner is called, an std::nullopt
sentinel is pushed to the queue, and after all remaining tasks are
finished and the sentinel is read, the thread finishes.
2023-03-09 11:54:38 +01:00
..
2023-02-01 20:14:51 -03:00
2023-02-28 21:56:53 +08:00
2023-02-01 20:14:51 -03:00
2023-02-01 20:14:51 -03:00
2023-02-01 20:14:51 -03:00
2023-02-15 11:01:50 +02:00
2023-02-01 20:14:51 -03:00
2023-02-15 11:01:50 +02:00
2023-02-14 11:19:03 +02:00
2023-02-01 20:14:51 -03:00
2023-02-19 21:05:45 +02:00
2023-02-15 11:01:50 +02:00
2023-02-01 20:14:51 -03:00
2023-02-19 12:58:22 +08:00
2023-02-01 20:14:51 -03:00
2023-03-04 13:11:25 +08:00
2023-02-01 20:14:51 -03:00
2023-02-28 21:56:53 +08:00
2023-02-15 11:01:50 +02:00
2023-02-01 20:14:51 -03:00
2023-02-01 20:14:51 -03:00
2023-02-15 11:01:50 +02:00
2023-02-01 20:14:51 -03:00
2023-02-28 21:56:53 +08:00
2023-02-15 11:01:50 +02:00
2023-02-15 11:01:50 +02:00
2023-02-15 11:01:50 +02:00
2023-02-28 21:56:53 +08:00
2022-11-16 16:30:38 +02:00
2023-02-28 21:56:53 +08:00
2023-03-02 09:22:14 +02:00
2023-02-01 20:14:51 -03:00
2023-02-01 20:14:51 -03:00
2023-02-28 21:56:53 +08:00
2023-02-01 20:14:51 -03:00
2023-02-19 21:05:45 +02:00
2023-02-28 21:56:53 +08:00
2023-02-01 20:14:51 -03:00
2023-03-01 09:58:14 +02:00
2023-02-01 20:14:51 -03:00
2023-02-01 20:14:51 -03:00
2023-02-15 11:01:50 +02:00
2023-02-28 21:56:53 +08:00
2023-02-01 20:14:51 -03:00
2023-02-01 20:14:51 -03:00
2023-02-17 07:19:52 +02:00
2023-02-01 20:14:51 -03:00
2023-02-01 20:14:51 -03:00
2023-02-01 20:14:51 -03:00
2023-02-01 20:14:51 -03:00
2023-02-19 21:05:45 +02:00
2023-02-19 21:05:45 +02:00
2023-02-01 20:14:51 -03:00
2023-02-01 20:14:51 -03:00
2023-02-01 20:14:51 -03:00
2023-02-01 20:14:51 -03:00
2023-02-01 20:14:51 -03:00
2023-02-01 20:14:51 -03:00
2023-02-28 21:56:55 +08:00
2023-02-15 11:01:50 +02:00
2023-02-15 11:01:50 +02:00
2023-02-28 21:56:53 +08:00
2023-02-15 11:01:50 +02:00
2023-02-28 21:56:53 +08:00
2023-02-28 21:56:53 +08:00
2023-02-28 21:56:53 +08:00
2023-02-28 21:56:53 +08:00
2023-02-01 20:14:51 -03:00
2023-02-15 11:01:50 +02:00
2023-02-19 21:05:45 +02:00
2023-02-14 11:19:03 +02:00
2023-02-01 20:14:51 -03:00
2023-02-01 20:14:51 -03:00
2023-02-01 20:14:51 -03:00
2023-02-15 11:01:50 +02:00
2023-02-14 11:19:03 +02:00
2023-02-15 11:01:50 +02:00
2023-02-28 21:56:53 +08:00
2023-03-01 10:45:18 +08:00
2023-02-03 19:04:32 +01:00
2023-02-28 21:56:53 +08:00
2023-02-01 20:14:51 -03:00
2023-02-28 21:56:53 +08:00
2023-02-01 20:14:51 -03:00
2023-02-28 21:56:53 +08:00
2023-02-28 21:56:53 +08:00
2023-02-15 11:01:50 +02:00
2023-02-01 20:14:51 -03:00
2023-02-15 11:01:50 +02:00
2023-02-28 21:56:53 +08:00
2023-02-19 21:05:45 +02:00
2023-02-01 20:14:51 -03:00
2023-02-01 20:14:51 -03:00
2023-02-28 20:04:22 +02:00
2023-02-28 21:56:53 +08:00
2023-02-28 21:56:53 +08:00
2023-02-28 21:56:53 +08:00
2023-02-01 20:14:51 -03:00
2023-02-28 21:56:53 +08:00
2023-02-10 07:11:38 +02:00
2023-02-21 17:42:18 +03:00
2023-02-28 21:56:53 +08:00
2023-02-17 17:58:26 +03:00
2023-02-28 21:56:53 +08:00
2023-02-09 17:11:31 +03:00
2023-02-28 21:56:53 +08:00
2023-02-15 11:01:50 +02:00
2023-02-01 20:14:51 -03:00
2023-02-01 20:14:51 -03:00
2023-02-15 11:01:50 +02:00
2023-02-01 20:17:16 -03:00
2023-02-01 20:14:51 -03:00
2023-02-01 20:14:51 -03:00
2023-02-19 21:05:45 +02:00
2023-02-01 20:14:51 -03:00
2023-02-28 21:56:53 +08:00
2023-03-06 12:59:41 +02:00
2023-02-22 09:32:30 +02:00
2023-02-01 20:14:51 -03:00
2023-02-01 20:14:51 -03:00
2023-02-01 20:14:51 -03:00
2023-02-27 15:09:42 +02:00
2023-02-06 12:44:40 +02:00
2023-02-15 11:01:50 +02:00
2023-02-01 20:14:51 -03:00
2023-03-09 11:54:38 +01:00
2023-03-09 11:54:38 +01:00