4 ms·
Just adding to this: > cooperative multitasking doesn’t necessarily equate to poor performance. I meant to say “poor interactive performance” The lack of con
by doctor_eval 3y ago
Just adding to this:
> cooperative multitasking doesn’t necessarily equate to poor performance.
I meant to say “poor interactive performance”
The lack of context switches in this model is likely to actually improve performance. So now I’m curious what would happen if we turned the Linux timeslice up to something stupid like 10s :)
- yencabulator 3y agoThe lack of context switches comes largely from having no security... That's the context being switched, memory protection!
- doctor_eval 3y agoThat doesn’t seem right to me. Of course a context switch includes the memory protection, but in a traditional OS there are also registers and other CPU state that need to be saved since a process can be interrupted just about anywhere. I suppose that I’m idealising a bit here but ISTM that the structure of FOMOS means that the CPU state doesn’t need to be saved, so the context switch involves only memory protection, register resets, stack pointer reset and little else. You don’t even need to preserve the stack between invocations. And unlike preemptive multitasking, there seems to be little or no writing to memory needed, which would seem to obviate a bunch of contention. (Noting that it’s 30 years since I fiddled with operating systems at this level) Frankly I find this really elegant and exciting.
- yencabulator 3y agoThe TLB flush is the only part of the context switch that's really slow, and it's the part that's needed for a security boundary.
- Aerbil313 3y agoTheseus OS has no context switches, while being even more secure than conventional OSes, all without any reliance on hardware-provided isolation. Theseus is a safe-language OS, in which everything runs in a single address space (SAS) and single privilege level (SPL). This includes everything from low-level kernel components to higher-level OS services, drivers, libraries, and more, all the way up to user applications. Protection and isolation are provided by means of compiler and language-ensured type safety and memory safety. https://www.theseus-os.com/Theseus/book/design/design.html https://www.theseus-os.com/Theseus/book/design/design.html
- yencabulator 3y agoYes, but Theseus doesn't run arbitrary binaries.
- Aerbil313 3y agoIt got Wasm support recently, and extending this idea of emulators/interpreters, it can run any arbitrary binary in the future.
- vacuity 3y agoWouldn't that be somewhat outside of Theseus' design and add overhead more akin to modern OSes? Theseus relies on Rust's type system (ownership/borrowing and otherwise) to ensure that all binaries have many verified properties; arbitrary WASM program can't hook into that, yes?
- Aerbil313 3y agoThe vast majority of programs running on a user's computer today are already running in a VM (JS and WASM), and the number is only increasing. I do not know of any argument in behalf of running everything in a VM (even when it's not a requirement) from a cybersecurity perspective, but I suspect there may be one. You're right, but maybe this is the way to go and the tradeoff to accept. After all, the ideas behind Theseus feel so obviously correct, alike to those of Nix.