|
while (1) { |
|
wait_sem(&s->start); |
|
post_sem(&ringthreads[post_to].sem.start); |
|
if (!trywait_sem(&s->stop)) |
|
goto out; |
|
} |
A race condition is possible for ring load. Suppose that there are two ring threads '0' and '1'. Consider the following case:
- '0' thread has executed the final
post_sem(&ringthreads[post_to].sem.start); and finished.
- '1' thread has received the final
start, but it hasn't received stop yet, and '0' thread has already finished, so '1' thread hangs in wait_sem(&s->start); forever.
interbench/interbench.c
Lines 733 to 738 in e612a65
A race condition is possible for
ringload. Suppose that there are tworingthreads '0' and '1'. Consider the following case:post_sem(&ringthreads[post_to].sem.start);and finished.start, but it hasn't receivedstopyet, and '0' thread has already finished, so '1' thread hangs inwait_sem(&s->start);forever.