It is useful/mildly common at the app level to want to get read events
for fd0 and write avail events for fd1. An app that might want to deal
with reads from stdin in one process and writes to stdout in another
(something like "team" perhaps) would have trouble here too.
Epoll's API/impl is great as it is IMO, not suggesting need for change, I was
hoping there was a good standard trick someone worked up to get around
this specifc end case of stdin/stdout usually being dups but sometimes
not. Porting my event system over to use epoll was easy/straightforward
except for this one minor hitch.
I considered:
- using a second epoll object just for one of the fd's (to inspire
delivery of the event to 2 wait queues in the kernel); a little
ugly because of need to stack another epfd under the main one
just for stdout write events
- select() on (0, 1, epfd) and just use epoll with a timeout of 0
when select fires to gather bulk of events; morally similar to
previous but using select (which I want to just get away from)
- make the app use stdin as its output (this is what I ended up doing);
breaks redirection of stdout but that doesn't matter to this app
Thanks,
-Eric Varsanyi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/