Topic
1 reply Latest Post - ‏2007-10-03T12:32:08Z by SystemAdmin
SystemAdmin
SystemAdmin
1240 Posts
ACCEPTED ANSWER

Pinned topic volatile vs threadlocal

‏2007-10-03T04:45:29Z |
hi guys,

in what scenarios would you consider the use of threadlocal to be superior to simply making the data volatile?

is there performance benefits from using volatile over threadlocal?
any reason by this?

Thanks in advance,
Steven
Updated on 2007-10-03T12:32:08Z at 2007-10-03T12:32:08Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    1240 Posts
    ACCEPTED ANSWER

    Re: volatile vs threadlocal

    ‏2007-10-03T12:32:08Z  in response to SystemAdmin
    They are two different things. A volatile field is shared among threads, whereas the content of a ThreadLocal is unique to a given thread.