PortOS Project 4 FAQ
Frequently asked questions:
Receive Buffering
Suppose a receiver asks to receive up to 100 bytes from a socket, and a
packet containing 1500 bytes arrives. What should the receiver do ?
It should return the first 100 bytes to the receiver who is blocked
waiting for up to 100 bytes. It should then hold onto the remaining
1400 bytes so it can provide them to subsequent callers to minisocket_receive.
At no point in time should the same data be passed to multiple receivers,
be passed to callers out of order, or acknowledged but dropped.
Interleaving Suppose two threads both send large messages through the same
port. Should we enforce strict ordering of messages (all the fragments
of message A first, then message B), or is it okay to interleave
fragments?
It's okay to interleave fragments, and this will make the
implementation simpler. If the sender wants to avoid interleaving, it
can add some extra synchronisation itself.
Emin Gün Sirer, May 2002