I have two thread:
pthread_create(th1)
pthread_create(th2)
and a simple linked list
struct mNode{
char* name;
struct mNode* next;
}
mNode* head;
mNode* tail;
thread 1 th1: add new node after tail.
thread 2 th2: release node from head.
Do I need Synchronization this linked list? And how to?
I don't know more about semaphore. So I need some code more simple as possible.
Thanks!!!
Start Free Trial