On 26/01/16 19:27, Barbu Paul - Gheorghe wrote:
If this is an option, then I have a question:
As far as I read (cannot find the source atm.) the rump kernel provides no
threading (and scheduling, virtual memory, etc.).
If so, how is it possible to embed a HTTP server (that spwans threads to run
itself and to handle requests) inside an application?
In fact, now that I think of it, the nginx tutorial might also raise the same
question:
nginx most definitely spawns threads when handling requests, how is that done in
this kind of environment?
It must be something wrong in my understanding that there are no threads.
It's a bit like why can you do networking even if file systems don't
provide networking. Well, something else provides networking. The same
way you (hopefully) think that it would be completely ridiculous if your
system was not able to talk ipv6 since it uses ext2, it would be
completely ridiculous if your drivers could run on only one thread
implementation.
Rump kernels try not to be ridiculous, and therefore can run on any
thread implementation provided by some other entity. E.g. in the case
of Rumprun, that other entity is the small underlying "bmk"
bootstrap/firmware/whatever layer. See lib/libbmk_core/sched.c in the
Rumprun repo for how threads are created (and lib/librumprun_base/_lwp.c
for how those threads map to pthreads).