Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> - 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.



That's not what this says SOCK_DGRAM is: https://www.ibm.com/docs/en/aix/7.1?topic=protocols-socket-t...

I don't know how it could be. In order to send chunks of memory you first need primitives of memory that can be sent.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: