-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Lines 733 to 738 in e612a65
| 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 receivedstopyet, and '0' thread has already finished, so '1' thread hangs inwait_sem(&s->start);forever.
Metadata
Metadata
Assignees
Labels
No labels