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_hclh test gets stuck #141

Closed bmwiedemann closed 5 years ago

bmwiedemann commented 5 years ago

While working on reproducible builds for openSUSE, I found that the ck_hclh test gets stuck forever on 1-CPU (KVM) builds

[  133s] Waiting for threads to finish correctness regression...done (passed)
[  133s] ./ck_hclh 1 1
[  133s] Creating threads (mutual exclusion)...done
[243038s] Waiting for threads to finish correctness regression...

Steps to reproduce on openSUSE or Debian:

osc checkout openSUSE:Factory/ck && cd $_
osc build --noservice -j1 --clean

Version: ck-0.6.0 ; same problem with 0.7.0

cognet commented 5 years ago

Hi,

Indeed, the test was broken with CORES=1. I just pushed a fix, can you confirm it now works for you ?

Thanks !

bmwiedemann commented 5 years ago

With commit fd55609ca74c610285abe519babdf71f5a31e195 the test passes now. However, it is not obvious if the changed value of line 7 also applied to line 4's local_lock[CORES / 2]

A quick test with gcc -E shows that it does, but would have been nice to have it more obvious.

cognet commented 5 years ago

You're right, I'll move it before line 4

bmwiedemann commented 5 years ago

For reference: fa63a9517403f74d89f874744f889c5478d5d607

looks good. Will there be a new release before 2020 or should I consider to add the patch to our package?

cognet commented 5 years ago

I can't tell for sure, but given the low number of commits done since last release, if I were you I wouldn't expect a new release before 2020.

bmwiedemann commented 5 years ago

Thank you. I submitted the fix as a patch to openSUSE.