better comments and potential fix for work-stealing dequeue

It's better to use std::memory_order_seq_cst in pop() and
steal() because we rely on ordering of access to
mTop and mBottom members.
This commit is contained in:
Mathias Agopian
2019-06-26 18:31:04 -07:00
committed by Mathias Agopian
parent 56c2d6338e
commit 12fde30f31
2 changed files with 81 additions and 38 deletions

View File

@@ -116,7 +116,7 @@ TEST(JobSystem, WorkStealingDequeue_PopSteal) {
steal_thread3.join();
pop_thread.join();
EXPECT_TRUE(queue.isEmpty());
EXPECT_TRUE(queue.getCount() == 0);
}
TEST(JobSystem, WorkStealingDequeue_PushPopSteal) {
@@ -185,7 +185,7 @@ TEST(JobSystem, WorkStealingDequeue_PushPopSteal) {
push_pop_thread.join();
EXPECT_EQ(pop+steal0+steal1+steal2+steal3, size);
EXPECT_TRUE(queue.isEmpty());
EXPECT_TRUE(queue.getCount() == 0);
}