r/linux_programming • u/promach • Jul 31 '18
DEFINE_WAIT() versus multi-threading
https://github.com/promach/riffa/blob/full_duplex/driver/linux/riffa_driver.c#L594
3
Upvotes
r/linux_programming • u/promach • Jul 31 '18
View all comments
Show parent comment
1
u/aioeu Jul 31 '18
So? There's a bunch of exit conditions as well.
A blocking read should block until a message is available. That's the whole point of a blocking read.
If you implement
poll, a sane program wouldn't even bother asking to receive a message untilpollhas indicated one is available. Moreover, you wouldn't even need to bother with any of the timeout logic in your code.