Thank you for the quick response. Yes, it is an issue, and there's a solution to mitigate this risk by checking empty()/full() before getting an index. But anyway it's not strict wait-free, I see.
Thanks, Meng Anthony Williams <anthony....@gmail.com> 于2018年10月18日周四 下午5:02写道: > On 18/10/2018 09:23, 饶萌 wrote: > > I've just created a real wait-free MPMC queue in 100+ lines of C++11 > > code: WFMPMC <https://github.com/MengRao/WFMPMC>. > > > > Appreciate it if you can help check. > > This is not wait free. If you have two writers, and both take an index. > The writer with the lower index then gets suspended, but the writer with > the higher index completes. > > Now, the next reader has to wait, because the slot it is trying to read > from isn't complete yet, even though there is ready data in another slot. > > Cheers, > > Anthony > -- --- You received this message because you are subscribed to the Google Groups "Scalable Synchronization Algorithms" group. To unsubscribe from this group and stop receiving emails from it, send an email to lock-free+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/lock-free/CAP%2Br3icp70t_cKEeSxUyNkggqdhAGKf8VV%2BBZ6qkg79WHYRuBQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.