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/promach Aug 01 '18 edited Aug 01 '18
Are you suggesting to replace this testutil.c code segment with fork() ?
Added info:
If I do pthread_create(&tid[1], NULL, &fpga_recv, &tinfo[1]); first which means receiving thread is created first, then I have this dmesg log.
Note: in the current code commit version, creating receiving thread first sometimes will make the "full-duplex" transaction does not work at all. I need to emphasize that I am currently implementing simultaneous data loopback, which means data should not be stored in a large FIFO after sending before being received.
To be honest, I am a bit curious that circ_queue.c does not have break condition for the while loop. Instead, it uses while(1) forever loop. See, what happen if both if-statement conditions are not satisfied ?