concurrencykit / ck

Concurrency primitives, safe memory reclamation mechanisms and non-blocking (including lock-free) data structures designed to aid in the research, design and implementation of high performance concurrent systems developed in C99+.
http://concurrencykit.org/
Other
2.38k stars 313 forks source link

ck_queue: fix logic inversion in CK_STAILQ_CONCAT. #107

Closed aidancully closed 6 years ago

aidancully commented 6 years ago

old version would only attempt to append head2 to head1 if head2 was empty.

aidancully commented 6 years ago

also, should the ck_pr_fence_store on line 240 move under the assignment to (head1)->stqh_last?

sbahra commented 6 years ago

also, should the ck_pr_fence_store on line 240 move under the assignment to (head1)->stqh_last?

Why? The current location is meant to serialize subsequent store operations associated with the list. The moment the structure becomes "visible" is after the volatile store operation. There is no reason to move it.

sbahra commented 6 years ago

Great catch! Merged in.