Linked by Hadrien Grasland on Sun 29th May 2011 09:42 UTC
OSNews, Generic OSes It's funny how trying to have a consistent system design makes you constantly jump from one area of the designed OS to another. I initially just tried to implement interrupt handling, and now I'm cleaning up the design of an RPC-based daemon model, which will be used to implement interrupt handlers, along with most other system services. Anyway, now that I get to something I'm personally satisfied with, I wanted to ask everyone who's interested to check that design and tell me if anything in it sounds like a bad idea to them in the short or long run. That's because this is a core part of this OS' design, and I'm really not interested in core design mistakes emerging in a few years if I can fix them now. Many thanks in advance.
Permalink for comment 475025
To read all comments associated with this story, please click here.
RE: RPC considered harmful
by Brendan on Mon 30th May 2011 03:27 UTC in reply to "RPC considered harmful"
Brendan
Member since:
2005-11-16

Hi,

The abstraction level of RPC interfaces is too low.


In my opinion, it's the opposite problem - the RPC interface is too high level.

A "call" can be broken into 4 phases - the callee waiting to be called, the caller sending data to the callee, the callee executing, and the callee sending data back to the caller.

This could be described as 3 operations - "wait for data", "send data and wait to receive data back" and "send data and don't wait to receive data back".

Now, stop calling it "data" and call it "a message" (it's the same thing anyway, mostly), and you end up with "get_message()", "send_message_and_wait_for_reply()" and "send__message()".

For synchronous software (e.g. emulating RPC); the callee does "get_message()" and blocks/waits until a message arrives, the caller does "send_message_and_wait_for_reply()" and blocks/waits until it receives the reply; and then the callee does "send_message()" to return the reply. It's exactly like RPC.

The interesting thing is that for asynchronous software, you'd use "send_message()" and "get_message()" and don't need anything else. Basically, by breaking it down into these primitives you get synchronous and asynchronous communication (rather than just synchronous); and people can mix and match without limitations. For example, you could have a fully asynchronous service, where one client process uses synchronous messaging to use the service and another client process uses asynchronous messaging to use the service, and the service itself doesn't need to care what each client is doing.

However, you would probably want to offer a few extra primitives to make things easier. For example, you might consider adding "send_message_and_wait_for_reply_with_timeout()", and "check_for_message()" (which would be like "get_message()" but returns a "NO_MESSAGES" error instead of blocking/waiting for a message when there are no messages to get).

-Brendan

Reply Parent Score: 2