Advertisement

06.04.2008 at 01:52PM PDT, ID: 23458358
[x]
Attachment Details

Simple Linked List and thread Synchronization

Asked by colorsit123 in Linux Programming, C Programming Language

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
 
Keywords: Simple Linked List and thread Synchron…
 
Loading Advertisement...
 
[+][-]06.04.2008 at 02:03PM PDT, ID: 21714126

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Linux Programming, C Programming Language
Sign Up Now!
Solution Provided By: evilrix
Participating Experts: 1
Solution Grade: B
 
 
[+][-]06.05.2008 at 10:50AM PDT, ID: 21722125

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628