J
Jorge
Hi
I am a bit confused about the synchronization with vectors:
In my application I have a vector in which a few threads add and remove
objects and another thread reads it every once in a while.
By now it is working, but I want to avoid possible random errors when
the threads start to make more insertions and deletions in the vector.
I have read how to synchronize using the sychronize keyword around the
statements that use the vector, but I have also read that the vector is
thread-safe. So should I synchronize by hand the access to the vector
or the vector class handle it for me??
(I know it is a pretty newbie question, but I hope that this is the
place to understand this)
Thanks in advance!
Jorge
I am a bit confused about the synchronization with vectors:
In my application I have a vector in which a few threads add and remove
objects and another thread reads it every once in a while.
By now it is working, but I want to avoid possible random errors when
the threads start to make more insertions and deletions in the vector.
I have read how to synchronize using the sychronize keyword around the
statements that use the vector, but I have also read that the vector is
thread-safe. So should I synchronize by hand the access to the vector
or the vector class handle it for me??
(I know it is a pretty newbie question, but I hope that this is the
place to understand this)
Thanks in advance!
Jorge