Re: Vector#toArray()
- From: "Allan Bruce" <amb@xxxxxxx>
- Date: Tue, 31 May 2005 13:27:21 +0100
"Patricia Shanahan" <pats@xxxxxxx> wrote in message
news:lgXme.2995$s64.953@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Allan Bruce wrote:
>
>> "Patricia Shanahan" <pats@xxxxxxx> wrote in message
>> news:yTFme.2473$s64.1759@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>
>>
>>> Allan Bruce wrote:
>>>
>>>
>>>> I am trying to code my application to benefit from running on a
>>>> parallel machine but it is not any
>>>> faster. I think I have some data which is too
>>>> synchronized so I am looking to avoid this. I have a
>>>> Vector which stores some data but I use toArray() to
>>>> get the data as an Object []. I am pretty sure that
>>>> this will now be non-synchronized but I thought I
>>>> would ask to check - is it?
>>>>
>>>> Thanks. Allan
>>>>
>>>>
>>>
>>> Vector's toArray method is synchronized, and needs to
>>> be synchronized. The toArray method would get very
>>> confused if the Vector were to change while it is
>>> running.
>>
>>
>> Yes, I meant: Is access to the array after this call
>> synchronized? I doubt it but thought I would check.
>
> Accesses to the array will be synchronized if, and only if,
> they occur in a synchronized context.
>
> Patricia
>
Thats what I thought, thanks!
Allan
.
- References:
- Vector#toArray()
- From: Allan Bruce
- Re: Vector#toArray()
- From: Patricia Shanahan
- Re: Vector#toArray()
- From: Allan Bruce
- Re: Vector#toArray()
- From: Patricia Shanahan
- Vector#toArray()
- Prev by Date: Re: return more than one object within one method
- Next by Date: Re: Java tools: Is eclipse everything what I need ?
- Previous by thread: Re: Vector#toArray()
- Next by thread: Creating key code protection for my application ?
- Index(es):
Relevant Pages
|