The server chose violence

# · 🔥 304 · 💬 62 · 11 days ago · cliffle.com · lukastyrychtr · 📷
A client is just a task using SEND, and a server is a task using RECV and REPLY - but they're not mutually exclusive. A task may be a server to some other tasks, and simultaneously a client to different tasks. An "LED Blinker" task may call into a "GPIO driver" task, which itself may call into a supervisory task. Because IPC crosses task boundaries, and tasks in Hubris are separately compiled programs, you have to be careful making these same assumptions with IPC. If a client is compiled against the wrong interface, or confuses one task for another, the compiler won't have any idea, since it sees only a single program at a time. When the recipient uses RECV, one client task "Waiting to send" to it is updated to "Waiting for reply." The client task will remain in that state until something changes - usually, the server using REPLY. REPLY only works on a task marked as "Waiting for reply" from the specific server task that is attempting to reply. REPLY FAULT is basically the same thing, except instead of delivering a message and making the task runnable, it delivers a fault and makes the task dead. With REPLY FAULT, we can avoid having unnecessary error handling on IPC operations, because correct programs will just go on as if the problem can't occur - and incorrect programs won't get to handle the error at all! Like REPLY, a server can only REPLY FAULT a task that is waiting for its reply.
The server chose violence



Send Feedback | WebAssembly Version (beta)