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


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

Re: where's your Vector, victor

From Robert Klemme <shortcutter@googlemail.com>
Newsgroups comp.lang.java.programmer
Subject Re: where's your Vector, victor
Date 2014-05-30 19:28 +0200
Message-ID <burtesFemg5U1@mid.individual.net> (permalink)
References <19baa0fb-e0fb-4565-b1eb-44018eb3045d@googlegroups.com> <lm9ngm$j5s$1@gregory.bnet.hr>

Show all headers | 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