link list & thread

View: New views
2 Messages — Rating Filter:   Alert me  

link list & thread

by Mohsen Pahlevanzadeh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear all,

I have a thread & 2 func.flush_2_db() is in thread & add_element() is
outside of thread.
add_element's job is adding data to link list.& flush_2_db()'s job is
reading list & drop from list.But my problem is override data & lost
data, because flush_2_db is in the thread & both work parallel.
Do you have any idea for solving my problem?

Yours,
Mohsen


Re: link list & thread

by Ian Lance Taylor-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mohsen Pahlevanzadeh <mohsen@...> writes:

> I have a thread & 2 func.flush_2_db() is in thread & add_element() is
> outside of thread.
> add_element's job is adding data to link list.& flush_2_db()'s job is
> reading list & drop from list.But my problem is override data & lost
> data, because flush_2_db is in the thread & both work parallel.
> Do you have any idea for solving my problem?

This question is not appropriate for the gcc@... mailing list.
This is a general programming question and has nothing to do with gcc.
Please ask on a general programming forum.

Ian