Let's say that we have two core working on the same linked list. One insert and update an entry, another one remove an entry on specific circumstances.
Well if I don't use lock segmentation fault is obvious. Mutex lock or any lock which lock the whole process of a core is not efficient and not good for my program.
I need a kind of lock which work like this: The thread that is inserting and updates an entry work all the time without stop unless its updating an entry which is decided to be removed from list bye the other thread. It is important that both thread can work on the list simultaneously.
If anyone know what kind of lock I should use for this purpose, please share it with me.
Note that the compiler is gcc, I can't use g++.