1. 41



  2. 7

    I’m curious on more details how the various modern derivations of L4 stack against it (he mentions in a parent comment in the 2015 thread that L4 compared well with QNX performance-wise, but claims it then went in some worse direction), as well as Minix 3 (esp. now that we know it was infamously used internally in Intel processors - would be super interested in some technical writeup on that!).

    1. 3

      Minix 3 was likely used for its reliability mechanism and permissive licensing. The use-case is probably not heavy on context switches or other ways to drag down performance.

      1. 2

        As far as I know, this trick of fast message-based synchronous IPC was invented by Jochen Liedtke / L4. That publication is from 1997. QNX was initially released 1982, so maybe QNX had it even earlier? From why I have heard this L4 paper had a big impact on the scientific community, so I don’t really know who was first. The paper only mentions QNX briefly:

        second-generation µ-kernels like QNX and L4 more rigorously aim at minimality and are designed from scratch

      2. 6

        Mach4 and OSF Mach also had something similar, named Migrating Threads [1], where the servers acted as passive objects while client’s threads migrated to them to serve the RPC.

        While coming from different conceptual backgrounds, the actual implementation and improvements achieved are quite similar. In the end, both are replacing costly, scheduler-driven context switches, with immediate light ones.

        [1] http://brynosaurus.com/pub/os/thread-migrate-slides.pdf/

        1. 2

          interesting! This also looks very similar to “doors” in illumos: http://illumos.org/man/3C/door_create + http://illumos.org/man/3C/door_call described a bit more for Solaris here: http://www.kohala.com/start/papers.others/doors.html

        2. 4

          […] there is a fast path where the sending thread is blocked, the receiving thread is unblocked, and control is immediately transferred without a trip through the scheduler.

          That’s really impressive. I could see this being a big deal in the case of processes doing a lot of this kind of IPC.

          1. 5

            There’s an interesting talk by Paul Turner (kernel engineer at Google): https://www.youtube.com/watch?v=KXuZi9aeGTw

            He describes some of the optimized thread-based programming models. It seems they arrived at similar thread swap primitives as well. I’m not sure if they’ve ever managed to upstream any of these ideas but it’s worth a watch.

          2. 3

            Somebody really should write a microkernel like this in Rust. The actual QNX kernel occupies only about 60K bytes on an IA-32 machine, plus a process called “proc” which does various privileged functions but runs as a user process. So it’s not a huge job.

            Would love this. I wonder how much Redox does/could do of this msg passing style.