Combined with an event loop, we have a new way of doing IO on linux without waiting on syscalls to complete before yielding back control to the progra

Do Files want to be Actors?

submited by
Style Pass
2025-01-04 04:00:05

Combined with an event loop, we have a new way of doing IO on linux without waiting on syscalls to complete before yielding back control to the program. You simply put things on the queue, and then you get right back to computing.

The opcode represents the OS level syscall, ie open, read, write etc. So even function call semantics are abstracted away by this OS interface.

Re-wind back to the 1970s, where Carl Hewitt and Henry Baker wrote the first paper about the actor model; Laws for Communicating Parallel Processes. In it they describe a base model for concurrent computations:

The action in the actor model consists of objects called actors sending messages to other actors, called the targets of those messages...an event E is the receipt of the message "message(E)" by the actor "target(E)". Upon receipt of this message in the event E, the target consults its script (the actor analogue of program text), and using its current local state and the message as parameters, sends new messages to other actors and computes a new local state for itself.

Is it just me, or are these too seemingly unrelated schools of computing converging on the exact same idea? You send messages to some target (ie, the file descriptor). You receive (or maybe you don't receive) responses back asynchronously. We're not concerned with function calls, or mutexes, or spinlocks - they're implementation details. We're concerned with sending messages concurrently.

Leave a Comment