Yes, I suppose if get was not synchronised it would give something like a dirty
read.....
Jesper Jorgensen
-----Original Message-----
From: James A. N. Stauffer [mailto:[EMAIL PROTECTED]]
Sent: Fri 10/05/2002 17:00
To: JDJList
Cc:
Subject: [jdjlist] Re: Vector synchronized get() method?
Correct but consider 1 thread calling get while another thread calling
remove or set. Use ArrayList for an unsynchronized list.
--- Jesper Jorgensen <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Does anyone have the answer to why the get(int index) method in the
> java.util.Vector class is synchronized?
> Since it doesn't modify anything two threads can safely access it
> concurrently - no?
>
> thanks,
> Jesper Jorgensen
>
> PS.
>
N‡!jxÊ‹«™é›z»!Šš)¶*'²·Ÿz»h†Ûiÿü0Â̬r‰Ü¢oãjö¿–+-qù
=====
= o o o o o o o . . . __________________________ _____=======_||___
o _____ | James A. N. Stauffer | | Stauffer_James |
.][__n_n_|DD[ ====____ | Spam food: [EMAIL PROTECTED] | | @yahoo.com |
>(________|__|_[________]_|________________________|_|________________|
_/oo OOOOO oo` ooo ooo 'o¬o¬o o¬o¬o` 'o¬o o¬o`
__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Mother's Day is May 12th!
http://shopping.yahoo.com
To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm
<<winmail.dat>>
To change your membership options, refer to: http://www.sys-con.com/java/list.cfm
