Atomic Operation

D

dimitrik107

I read sometime ago that there is new java feature to increment a long
as atomic operation so threads can safely add one to the long. I cannot
find name for such object, I think "AtomicLongIncrement" or something.
Maybe someone can remember.

I have been searching java doc, but cannot find it.
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

I read sometime ago that there is new java feature to increment a long
as atomic operation so threads can safely add one to the long. I cannot
find name for such object, I think "AtomicLongIncrement" or something.
Maybe someone can remember.

I have been searching java doc, but cannot find it.

Is it java.util.concurrent.atomic.AtomicLong you are looking
for ?

Arne
 
H

hiwa

(e-mail address removed) ã®ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸:
I read sometime ago that there is new java feature to increment a long
as atomic operation so threads can safely add one to the long. I cannot
find name for such object, I think "AtomicLongIncrement" or something.
Maybe someone can remember.

I have been searching java doc, but cannot find it.
Use a synchronized method, or block, for Java primitive type long.
Or, since Java 1.5, you could use
java.util.concurrent.atomic.AtomicLong and its method.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top