|
-
October 25th, 2006, 10:28 AM
#4
Re: Vector Retrieval Efficiency
When a code block is labeled as synchronised then only one thread can execute the containing code at a time, so there is a lock on the synchronised block. If other threads are also trying to execute that code they will be queued and then the next thread will be able to access it once the first thread has finished executing the code and released the lock.
So you should only use Vector if multiple threads are going to be hitting it, if not go with ArrayList.
Byron Tymvios
Please use [ CODE ] and [/ CODE ] tags when posting code! See THIS on how to use code tags.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|