The blocking/signalling is still missing though.
But also, by writing out to /tmp on memory-backed systems, the lack of blocking means you grow memory use potentially indefinitely if the reader is slow or delayed for some reason. That will ultimately turn into swapping, which is just disk access again.
There's also no great way to truncate the beginning of a regular file.
Out of curiosity, is there some good reason you'd do this instead of just using a mechanism that's specifically made to solve this problem?
What's wrong with
$ ./producer > my_rambacked_file & $ tail -f my_rambacked_file > ./consumer
Well, okay, I guess this way you don't get a signal that the producer is finished.
http://manpages.courier-mta.org/htmlman7/pipe.7.html
> POSIX.1-2001 says that write(2)s of less than PIPE_BUF bytes must be atomic: the output data is written to the pipe as a contiguous sequence. Writes of more than PIPE_BUF bytes may be nonatomic: the kernel may interleave the data with data written by other processes. POSIX.1-2001 requires PIPE_BUF to be at least 512 bytes. (On Linux, PIPE_BUF is 4096 bytes.) The precise semantics depend on whether the file descriptor is nonblocking (O_NONBLOCK), whether there are multiple writers to the pipe, and on n, the number of bytes to be written.
The only difference in behavior I can think of is timing. Generally, when you read a text file, you see what is written at that moment in time (barring race conditions). With named pipes, you read what has been written, and then wait until the program writing closes the pipe. If anything gets written in the meantime, you still see it. This lets you use them for message passing in a way that normal files do not.