Top
Best
New

Posted by ingve 16 hours ago

An OS with no threads: The Actor Model(www.timdbg.com)
295 points | 141 commentspage 3
hn_submit 9 hours ago|
I doubt if a fully cooperative threading operating system (because that's what it is essentially) can be made useful. MMURTL, for example, is mostly a cooperative threading operating system but it does have some preemption mostly to handle high priority messages coming from interrupts.
timmisiak 8 hours ago|
I'd agree that it's not useful as a general purpose model with a third party app system. In this system, "native" apps are all built and verified with a single toolchain, and anything outside of that lives in a lightweight Linux VM.

So for purpose-built applications I think it can be useful. As a general purpose OS where people want to run a browser, it's probably not likely to be useful.

evmar 8 hours ago||
The OS runs Firefox (per another post on the blog), which itself uses threads. How does that work? I guess you need some sort of translation layer to run Linux binaries, which then implements threading atop this actor system?
rbanffy 13 hours ago||
I would love to see a Smalltalk implementation on top of this.
abecedarius 10 hours ago|
E wasn't Smalltalk but was designed by Smalltalk enjoyers: https://web.archive.org/web/20261128134610/www.erights.org/
hollowonepl 11 hours ago||
Yep, it's super fun to write your own OS. Especially in the AI era to accelerate theory testing as the one attached in the blog post.

If I agree with it, I don't know.. I have my OS development testing my own theories for last 6 months.. and again.. all I can say is that it's fun, thoughtful and interesting to pursue product management learning points in such project. Completely doable for a single person to have something that works and is complete and from scratch. No Temple OS bullshit for schizophrenics.. No need to be cursed by Perkele like Linus to find devil's skills to convince the community to adopt a school project and go nuts with global adoption..

just for fun, real, yet homebrew OS that can run on your own hardware.. or cyberdeck that may be your next project when you get your OS running on boring mundane laptop just fine.

signa11 15 hours ago||
perhaps it is time to discuss the torvalds-vs-tannenbaum debate once again in $CURRENT era ?
pjmlp 14 hours ago||
That has already been won, outside BSD/Linux universe, most OSes are hybrid, with tons of userspace processes and drivers, also microkernels have won on the embedded RTOS space.

Also running cloud software, serverless runtimes, or distroless containers, on top of type 1 hypervisors, is pretty much a microkernel like architecture.

kvuj 10 hours ago||
> outside BSD/Linux universe

I feel like you're glossing over 80%+ of smartphones and 90%+ of all servers with that single mention, lol

pjmlp 9 hours ago||
I feel like you're glossing over how Android actually works since version 8, iOS and iPad OS since version 16, and the 2nd paragraph of my comment. LOL
hnlmorg 15 hours ago||
Were they talking about actor models too?

I remember the debates about monolithic vs microkernel designs. But it was so long ago that I can’t remember any of the specifics.

mrkeen 15 hours ago|||
Yeah, the thrust of the pushback was something along the lines of "great, your individual modules are small enough to reason about individually, but now you've dumped too much complexity into the communication channels instead"
hnlmorg 14 hours ago||
Ahhh yes. Thanks for sharing.
cowlevel 5 hours ago||||
OS development has kind of stalled out for the past two decades - we just took whatever we had in 2002 and froze it there. This presentation is about the hardware side but still inspiring: https://www.usenix.org/conference/osdi21/presentation/fri-ke...
hnlmorg 3 hours ago||
It didn’t stall. There’s been plenty of research kernels out there. There just isn’t much need for anything that isn’t one of the big established players because ultimately you need to be able to do something useful with that OS. And the big players aren’t going to radically change their platform because it would break things for their users.

So what you end up seeing more of in mainstream platforms is tooling around virtualisation and containerisation (neither new or novel, but for whatever reason, Windows and Linux have been decades behind the old guard).

signa11 15 hours ago|||
> ... debates about monolithic vs microkernel designs

message passing was the mechanism underneath the debate, and not the headline afaik.

skilesare 11 hours ago||
Neat! I've been working on generalizing the Motoko(actor based language that compiles to warm) to a general runtime at https://moxzi.ai, and I hadn't considered pushing it down to the OS level. If you are looking for a higher level actor based language motoko is worth a look.
thornjm 14 hours ago||
Im familiar with the actor pattern but completely naive to their implementation. I’m having trouble imagining a few things and might be way off the mark. A few questions that might help others resolve my confusion:

1. Are there as many processes as there are cores on the CPU?

2. Is there a single message queue shared across cores?

3. Presumably two networking actors or two filesystem actors could be processing different messages on different cores and hardware resources can still be contested?

RossBencina 13 hours ago||
I'm only familiar with implementing run-to-completion actors. If a message is sent to an actor, the actor's behavior needs to run to process the message. You could have a message queue per thread (physical or logical core), or a message queue per actor, with a separate scheduler to decide when each actor should get a chance to run. There are obvious performance benefits to keeping communication local to a core, so hierarchical architecture where there are core-local actor networks and cross-core networks can make sense.

As to your final question, actors processing messages is a computation, i/o of any kind would involve sending messages to other lower-level i/o actors that multiplex or coordinate access to individual hardware resources.

mightyham 12 hours ago|||
> 3. Presumably two networking actors or two filesystem actors could be processing different messages on different cores and hardware resources can still be contested?

I won't presume this is how DbgOS works, but considering that the author mentions writing drivers as actors, I would imagine that two actors would not be allowed to represent the same underlying resource. You would have one actor for each device, then and only then can any number of other concurrent actors build functionality on top of it through message passing.

monocasa 13 hours ago||
1) Typically the number of actors and hardware threads are disconnected and it uses some MxN scheduler. There's a lot of related techniques here, green threads, user threads, coroutines, fibers, etc. Though the implementation under discussion here only uses one hardware thread, and looks a lot like the single threaded models like how node wraps libuv.

2) It can be thought of as at least one message queue per actor.

3) Yep.

Shorel 8 hours ago||
That kinds of remind me of preemptive scheduling in Windows 3.1.

There are no actual threads, all programs collaborate to share the single processor they had at the time.

McKorty 8 hours ago||
I my passion game project is my world-server an only node-process with eventloops, presence, movements, talk bubbles etc. run without threads. A challange is a chess computer, he run in an own worker_threads, they comunicate only about messages and don't share space. Max. 2 claculatons at the same time, others wait in a queue. Is this yet a Actor-Modell or stilla worker-pool?
mosura 13 hours ago|
Is it possible this guy never ran into a UI event loop? Like winmain or the Android Handler . . .

Android actually works an awful lot like this, without calling it actors.

nottorp 12 hours ago||
Well most async enthusiasts haven't either :)
More comments...