why is it ok for a reader to exist when there are no writers but not ok for a writer to exist when there are no readers in pipes?
. Is it because the reader is meant to wait so it’s ok if there is no writer whereas a writer is ready with data and it is not known how long it has to wait even though it has data ready.
. Is it because the writer’s file descriptor can be misused by readers( I’m not clear how)
In the case of a reader, it will immediately block (sleep) because there’s nothing to read. If to writer starts the reader continues to sleep, and no harm done.
For a writer, it would fill up the buffers and block. If no reader came along it would be a pure waste of system resources.
FYI, the above is an educated guess.