[ee122] Blocking I/O

vern at cs.berkeley.edu vern at cs.berkeley.edu
Sun Dec 9 23:12:09 PST 2007

> If my_send() were to return immediately (like it "should"), control
> returns to the application layer. Any logic regarding timeouts,
> receiving ACKs, resending packets, or queuing until the window is clear
> is gone. For all of this to work, my_send() has to greedily hold onto
> control of execution until *everything* is done and it's satisfied
> things are in a steady state. Is this correct, or am I missing something
> subtle (or glaringly obvious)?

That's correct.  (This is a point that was discussed on the mailing list

> A sane approach would be to use threads to take care of the background
> work so that my_send() wouldn't need to block, but instead just drop the
> data off into a queue for some other thread to come along and work on.
> But threads are apparently out of scope

Threads are not out of scope; rather, we did not want to require them, so
to keep things simple we said it's okay to structure your implementation
to work with a single call to my_send() that gives it the entire item to
be transferred.


More information about the ee122 mailing list