> - there could be better primitives for communication than a byte stream. Why can't I just send another process a chunk of memory?
Isn't this just
write(fd, buffer, size_of_buffer)?
I'm not sure why everyone talks about byte streams being the basis here. If fd is a socket in SOCK_DGRAM mode, then buffer is received wholesale, never split. Bytestreams are not the fundamental abstraction. Files and sockets are.
> - the posix byte stream API is bizarrely based on a flat buffer instead of a ring buffer, which is just the obviously wrong data structure IMO.
Once again, this depends on the mode of the socket. you can put a Unix socket into a mode where it starts dropping packets when the queue is full.
> - Too much of the threading API is preempted threads, when cooperative scheduling (aka yielding) is so much easier to implement and understand.
Cooperative scheduling is part of POSIX. setcontext, makecontext, getcontext, and swapcontext.
Isn't this just
write(fd, buffer, size_of_buffer)?
I'm not sure why everyone talks about byte streams being the basis here. If fd is a socket in SOCK_DGRAM mode, then buffer is received wholesale, never split. Bytestreams are not the fundamental abstraction. Files and sockets are.
> - the posix byte stream API is bizarrely based on a flat buffer instead of a ring buffer, which is just the obviously wrong data structure IMO.
Once again, this depends on the mode of the socket. you can put a Unix socket into a mode where it starts dropping packets when the queue is full.
> - Too much of the threading API is preempted threads, when cooperative scheduling (aka yielding) is so much easier to implement and understand.
Cooperative scheduling is part of POSIX. setcontext, makecontext, getcontext, and swapcontext.