Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #28621

Re: where's your Vector, victor

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Robert Klemme <shortcutter@googlemail.com>
Newsgroups comp.lang.java.programmer
Subject Re: where's your Vector, victor
Date Fri, 30 May 2014 19:28:59 +0200
Lines 20
Message-ID <burtesFemg5U1@mid.individual.net> (permalink)
References <19baa0fb-e0fb-4565-b1eb-44018eb3045d@googlegroups.com> <lm9ngm$j5s$1@gregory.bnet.hr>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding quoted-printable
X-Trace individual.net Z8MSGS2U+wzk6C8BfHFM5A452qp1QhY5RkgJu+yWTRpvBtoXM=
Cancel-Lock sha1:iYmBWZMFXWreMgVFAlfP0TQPB38=
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0
In-Reply-To <lm9ngm$j5s$1@gregory.bnet.hr>
Xref csiph.com comp.lang.java.programmer:28621

Show key headers only | View raw


On 30.05.2014 12:45, Josip Almasi wrote:
> On 05/30/2014 10:11 AM, bob smith wrote:
>> I read that the Vector class is obsolete.
>>
>> Can someone tell me in a nutshell why this is so?
>
> Same as with Hashtable.
> It's all synchronized, = slow.
> And to make things worse, returned iterators are not synchronized:)

This is not true.  java.util.Vector.Itr<E> does go through the same 
mutex as the Vector it is iterating.  But, as Jörg and others have 
noted, synchronizing all methods is not sufficient to ensure thread 
safety - especially not if multiple method calls must be executed 
atomically.  Then you still need an explicit synchronized block.

Cheers

	robert

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

where's your Vector, victor bob smith <bob@coolfone.net63.net> - 2014-05-30 01:11 -0700
  Re: where's your Vector, victor Josip Almasi <joe@vrspace.org> - 2014-05-30 12:45 +0200
    Re: where's your Vector, victor Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-05-30 08:06 -0400
    Re: where's your Vector, victor Robert Klemme <shortcutter@googlemail.com> - 2014-05-30 19:28 +0200
  Re: where's your Vector, victor Joerg Meier <joergmmeier@arcor.de> - 2014-05-30 12:58 +0200
  Re: where's your Vector, victor Knute Johnson <eternal@knutejohnson.com> - 2014-05-30 07:32 -0700
    Re: where's your Vector, victor Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-05-30 11:31 -0400
      Re: where's your Vector, victor Robert Klemme <shortcutter@googlemail.com> - 2014-05-30 19:30 +0200
      Re: where's your Vector, victor Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2014-05-31 00:30 +0300
        Re: where's your Vector, victor Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-05-30 18:23 -0400
          Re: where's your Vector, victor Robert Klemme <shortcutter@googlemail.com> - 2014-05-31 12:17 +0200
      Re: where's your Vector, victor leif.roar@invalid.com (Leif Roar Moldskred) - 2014-06-01 07:37 -0500
  Re: where's your Vector, victor Roedy Green <see_website@mindprod.com.invalid> - 2014-06-06 01:00 -0700

csiph-web