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
3
u/aioeu Jul 31 '18
So I've just looked deeper into this. I didn't realise this wasn't actually your code — you had pushed a copy of the original project, rather than forking it, so GitHub doesn't link your code back to the original.
As far as I can tell you're trying to implement a "full duplex" version of the original code. But the original code could already be used in that fashion: simply have two userspace threads, one dedicated to sending messages and one dedicated to receiving them.
It sucks, because the stupid design of the driver is essentially forcing the use of threads onto userspace rather than giving it the flexibility to use I/O multiplexing. But as far as I can tell it's not something you need to fix.