-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zpipe reads block on closed writer #4
Comments
I'm wondering how we'd do this with multiple writers. On Thu, Mar 13, 2014 at 11:58 PM, Ron Pedde notifications@github.comwrote:
|
My thought is, a normal pipe has one writer and N readers; each will get On Fri, Mar 14, 2014 at 12:04 AM, Pieter Hintjens ph@imatix.com wrote:
|
I do think there is advantage to sending start and ends. Right now, we are doing synchronous pipe writes, which I remember you saying limited our throughput significantly. If we send an end state, we could run without acks until the close, and just ack the close and return errors on the close. We'd still have guaranteed delivery (although the error would come at close rather than write), but our throughput would improve. Plus we'd have proper close semantics, at least on a 1-to-1 pipe. For n-to-n, i think the right implementation is one that tracks real pipe semantics -- open with mode, and track number of reader/writers. |
Asynchronous pipe writes will certainly be faster. Are there specs somewhere for real n-to-n pipe semantics? I can see some problems trying to keep consistent state across multiple nodes with N writers. |
I don't think the posix definitions are available. Off the top: readers block until a writer connect, writes less than PIPE_BUF (4k on linux, I think) are guaranteed to be atomic, and not intermingled with other writes. Writers block until a reader connects. When the last writer closes, read() returns 0. When the last reader closes, writes against the pipe sigpipe. I'll try and find more formal specs. |
ZeroVM needs a pub-sub model where data is copied to every reader. Let's On Fri, Mar 14, 2014 at 10:59 PM, Ron Pedde notifications@github.comwrote:
|
Fixed by #9 |
Right now, zpipes implements an infinite pipe. But in order to implement true named pipe semantics over zpipes, it is necessary that the client can detect remote writer close and return a zero byte read.
The text was updated successfully, but these errors were encountered: