c - List insertion, disjoint n parallel? -


i have been searching concurrent linked list implementations/academic papers allow concurrent insertions disjoint places in list. prefer lock based approach.

unfortunately, implementations i've checked out far use list based locking opposed akin node based locking.

any people?

edit 1: initial responses. using node based locking means insertion after node or deleting node need lock previous , next node. entirely possible time thread 1 tries lock previous node got deleted in thread 2. how guard against such accidents?

i'm not able recommend libraries c specifically, if end doing potentially avoid having have thousands of locks re-using small number of locks , "hashing" decide use each node. you'd quite number of cases there wouldn't contention if number of locks suitably larger number of nodes little space overhead (and it's fixed, not per node).

update, edit 1

you work around having per-list multiple reader, single write lock, (rwlock), acquire "read" lock prior getting per-node lock inserts, delete need single "write" lock. avoid unnecessary synchronisation issues read/insert operations , deleting simple enough. (the assumption delete rarer insert though)


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -