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

Problems using CK_LIST #60

Closed hbowden closed 9 years ago

hbowden commented 9 years ago

I'm trying to use concurrencykit in my project https://github.com/Secure-Labs/nextgen more specifically I'm trying to use CK_LIST but I can't find any documentation or examples other than the regression test that come with concurrencykit. I figured out how to use CK_LIST in a single process but when I try to use CK_LIST from shared memory between two processes the values in CK_LIST are garbage. This stackoverflow question shows examples: http://stackoverflow.com/questions/32361619/how-to-share-ck-list-across-processes .

sbahra commented 9 years ago

Cool project! CK_LIST is a single-writer many-reader list that is a search-and-replace replacement for BSD-style queue.h. The online manual page is plagued by a man2html bug, but local man page should point this out. If you're using it in the context of multiple address spaces, you need to make sure that the addresses are consistent (including the backing) across the address spaces, this is a problem for any pointer-based data structure. A cursory scan of the example code provided indicates that no such guarantees are made for the actual data or list items (see the usage of malloc).

For future reference, there is a Google Group / mailing list that can be used for such discussions or questions, issues are good for work tracking on the other hand. Let me know if you've other questions!