• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using Threadlocal in a singleton class

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all

I have a doubt regarding using thread local variables.. consider the following code



My first question is I want thread local present in the same class where rest of the methods are also present(On browsing internet everybody is making it in separate class and making thread local object in it ).....i want it in the same class(is the usage correct??)
My top level is singleton ..do I have any issue because of it..Also if threadlocal is static will it have any issue


Thanks in advance
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, it's really not clear what you're asking. Can you try to clarify a bit? Maybe add some examples?

Also, please don't use large blocks of bold text. It's hard to read. Thanks!
 
reply
    Bookmark Topic Watch Topic
  • New Topic