[genode] Does order matter?
norman.feske at ...1...
Mon Jan 21 13:12:14 CET 2013
> GENODE_RPC_INTERFACE(Rpc_func_a, Rpc_func_b);
> GENODE_RPC_INTERFACE(Rpc_func_b, Rpc_func_a); /* the order of
> func_a and func_b is reversed */
> Do the above two RPC call definitions are equally OK?
yes. Functionality-wise they are the same.
Under the hood of the RPC framework, the order determines the assignment
of opcodes to the RPC functions of an RPC interface. Thereby it
implicitly defines the sequence of how the opcode of an incoming RPC
request is matched against the different RPC functions on the server
side. So strictly speaking, the order influences the performance of
dispatching an incoming RPC call. For example, if a RPC function is the
third function specified in the RPC interface, the server will always
compare the incoming opcode against the first end second function before
successfully matching the third. So the dispatching of the third RPC
function carries the overhead for those two negative checks. That said,
I think that the effect is negligible. Given the total costs involved in
performing an RPC call (context switches, IPC path, security checks),
changing the order should hardly make any measurable difference. If you
find otherwise, I'd be highly interested in investigating. ;-)
Dr.-Ing. Norman Feske
http://www.genode-labs.com · http://genode.org
Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
More information about the users