Local Procedure Calls
Remote Procedure Calls is when the caller and callee reside on different processes, i.e. cannot access variables from the stack. RMI (remote method invocation) is the same idea, but specifically for object-oriented programming.

RPCs come with many failures, hard to guarantee exactly-once semantics
| RPC Semantic | [client] Retransmit request? | Filter duplicate requests? | [server] Re-execute function OR retransmit reply? | Example RPC |
|---|---|---|---|---|
| at-least once | yes | no | re-execute because we need the op to happen at least once, and can also retransmit but re-exec is more strict so we highlight that :) | Sun RPC |
| at-most once | yes | yes | re-transmit because we don’t want to re-execute anything that would violate at most once, but this means we need state to keep track of whether the function was executed or not and the result of the execution | Java RMI (re-transmits on timeout) |
| maybe (best-effort) | no | N/A | N/A | CORBA (common object request brokerage architecture) |
Idempotent operations can be executed multiple times without any side effect, these are OK to run with at-least once semantics (ex: x = 1)
client stub → uses same caller() code to handle RPCs + LPCscommunication module → communicates between hosts (ex: protobuf in gRPC)dispatcher → selects which server stub to forward to, call call multiple server stubsserver stub → calls callee(), takes its return valueProgrammer only writes code for caller() and callee() functions, everything else is autogenerated

caller() and callee() processes store data on their hosts based on the architecture
12-AC-33 in the register looks like R[0] = 12, R[1] = AC, R[2] = 3312-AC-33 in the register looks like R[0] = 33, R[1] = AC, R[2] = 12Marshaling converts caller() arguments → CDR
Unmarshaling converts CDR → callee() arguments
Transactions are a series of operations, where each operation is an RPC to the server. The entire transaction can either be COMMIT or ABORT at the end.