You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of bug:
in udp_buffer, full and free share the same condition_variable. In one scenario, when most of the thread are waiting, excepting one that is going to release() udp_buffer, it is possible that release() will wake up the thread that is waiting in full queue. The thread wakes up and checks the full queue, since it's empty, so it wait again. Dead lock at the end.
This issue can be easily reproduce by changing the TEST below.
Steps to reproduce the issue:
1.
TEST (udp_buffer, many_buffers_multithreaded)
{
rai::stat stats;
rai::udp_buffer buffer (stats, 512, 16); --> change 16 to 4 or 2.
The text was updated successfully, but these errors were encountered:
Makes sense. It doesn't seem like this would deadlock but would stall processing until subsequent buffers came in and eventually the correct thread picked it up.
It seems the fix is to notify_all instead of notify_one. Does that sound like it fixes it?
Description of bug:
in udp_buffer, full and free share the same condition_variable. In one scenario, when most of the thread are waiting, excepting one that is going to release() udp_buffer, it is possible that release() will wake up the thread that is waiting in full queue. The thread wakes up and checks the full queue, since it's empty, so it wait again. Dead lock at the end.
This issue can be easily reproduce by changing the TEST below.
Steps to reproduce the issue:
1.
TEST (udp_buffer, many_buffers_multithreaded)
{
rai::stat stats;
rai::udp_buffer buffer (stats, 512, 16); --> change 16 to 4 or 2.
The text was updated successfully, but these errors were encountered: