From beginner in Java: Atomic type-what is it?

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Aug 2007
Posts: 18
Reputation: Ainur is an unknown quantity at this point 
Solved Threads: 0
Ainur Ainur is offline Offline
Newbie Poster

From beginner in Java: Atomic type-what is it?

 
0
  #1
Aug 4th, 2007
Dear all

Could you tell me what is it-atomic type in Java? I explored internet and book Java in 21 days,but nothing about it. The question was about difference between object reference and atomic type. I found that object reference is an address that indicates where an object's variable and methods are stored.

Thank you
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 71
Reputation: indienick is an unknown quantity at this point 
Solved Threads: 2
indienick's Avatar
indienick indienick is offline Offline
Junior Poster in Training

Re: From beginner in Java: Atomic type-what is it?

 
1
  #2
Aug 4th, 2007
There is no atomic "type" in Java.

All of the classes in the java.util.concurrent.atomic package have the "Atomic" prefix in their names.

All of those classes "...provide atomic access to arrays of values and provide volatile access semantics for array elements, which is not possible with the volatile modifier itself." (Java in a Nutshell 5th Edition, pg. 855)

volatile
Roughly speaking, a volatile field is like a synchronized method: safe for concurrent use by two or more threads. More accurately, volatile says that the value of a field must always be read from and flushed to main memory, and that it may not be cached by a thread (in a register or CPU cache).
I hope that answers your question.
Angel-headed hipsters burning for the ancient heavenly connection, to the starry dynamo in the machinery of the night.
-Ginsburg

Don't tell me to "google it" - I already have.
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 18
Reputation: Ainur is an unknown quantity at this point 
Solved Threads: 0
Ainur Ainur is offline Offline
Newbie Poster

Re: From beginner in Java: Atomic type-what is it?

 
0
  #3
Aug 4th, 2007
Thank you!
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 71
Reputation: indienick is an unknown quantity at this point 
Solved Threads: 2
indienick's Avatar
indienick indienick is offline Offline
Junior Poster in Training

Re: From beginner in Java: Atomic type-what is it?

 
0
  #4
Aug 4th, 2007
You are very welcome!
Angel-headed hipsters burning for the ancient heavenly connection, to the starry dynamo in the machinery of the night.
-Ginsburg

Don't tell me to "google it" - I already have.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: From beginner in Java: Atomic type-what is it?

 
0
  #5
Aug 5th, 2007
An atomic type in the context referred to most likely should be read as a primitive type.

That's int, long, double, float, byte, and char.
They don't refer to Object references, like everything else.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: From beginner in Java: Atomic type-what is it?

 
0
  #6
Aug 5th, 2007
And technically primitives are stored in a different memory space from object instances (but not the references you deal with to those instances).
But they can be stored in different memory spaces depending on where and how they're created, where object instances are always created in the same space.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC