vivekian wrote:
Trying to write an application in linux where two threads share the
same object ( primarily a double linked list ) . How do i implement
such an object ? Or is there a better way to do this ?
In plain computer science terms you have two choices, build
serialization (locking) into the list manipulators. (insert, delete,
update, traversal) Or use an external lock to control any/all access to
the list.
In real-world terms on Linux it is probably easiest to go the secound
route with std::list and pthreads. Why re-invent the wheel when such
nice, usable wheels are already available? ;-)