read/write wait logic may be deadlock
Closed this issue · 0 comments
kou commented
If we can't read/write any data, the current logic waits until any readable data/write space is available. For example, here is the read wait workflow:
read()
-> 0 bytes readwait()
- Check the current readable size in a shared buffer
- Loop
- Check the current readable size in a shared buffer
- Compare 2.ii.a with 2.i
We don't acquire a lock between 1. and 2.i. If new data is arrived between 1. and 2.i, the new data isn't detected. It may cause a deadlock.