Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2006

Tip: Looking for answers? Try searching our database.

Atomic Operation

Thread view: 
dimitrik107@hotmail.com - 27 Aug 2006 02:43 GMT
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.
Arne Vajhøj - 27 Aug 2006 02:47 GMT
> 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
dimitrik107@hotmail.com - 27 Aug 2006 22:44 GMT
Yes! Thank you. My javadoc were older than compiler. I got newer
javadoc now.
> > 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
[quoted text clipped - 7 lines]
>
> Arne
hiwa - 27 Aug 2006 02:49 GMT
dimitrik...@hotmail.com のメッセージ:

> 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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.