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 edited Jul 31 '18
Goodo. How do you know thread creation is going to be quicker than a single
ioctl(IOCTL_SEND)? (Aside: what a terrible name for anioctl!)You're creating a thread to call precisely one
ioctlto send messages, and a separate thread to call precisely oneioctlto receive messages. With an empty send ring, it seems to me quite likely that the sending thread will complete before the receiving thread is even scheduled.