Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8909625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:28:42+00:00 2026-06-15T03:28:42+00:00

I was reading about ThreadLocal class when I came across the below statement by

  • 0

I was reading about ThreadLocal class when I came across the below statement by Joshua Bloch multiple times..

“Sleazing” values through callbacks that you don’t control: sometimes you must call a library method that calls back into your package. At this point, you need some context that you were unable to pass to yourself, due to deficiencies in the library. In this rare situation, thread locals can be a lifesaver.

Having a hard time understanding this one..Would appreciate if someone could elaborate and explain

Thanks..Heena

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T03:28:44+00:00Added an answer on June 15, 2026 at 3:28 am

    My application calls a library that searches stored data.

    That library also has an interface you can implement that tells it how to convert the raw results of a search into the data format that you want.

    My implementation of how to convert search results into the objects I want, involves knowing a particular time zone.

    So the process is, (A) I call library search method, (B) search method then calls my other piece of code that converts raw results into my format, (C) my conversion requires knowing a timezone. The challenge is how do I make information, the timezone, that I know at point A, available at point C?

    Obviously the methods that the library offers don’t include passing around a time zone, so I stick it in a ThreadLocal!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While reading about mcv3 I came across an attribute name called [ActionName] . It
While reading about shell scripts and temporary file handling, I came across Symlink Exploits.
While reading about bitmap processing in C++ I came across this block of code
While reading about synchronization, I came across monitor pattern to encapsulate mutable states. The
Reading about Delphi's Exit statement (see here for instance), I cannot ignore that writing
While reading about exception, I will always come across checked exceptions and unchecked exceptions,
I've been reading about ThreadLocal, trying to understand how it works and why we
I'm reading about the CallContext class ( http://msdn.microsoft.com/en-us/library/system.runtime.remoting.messaging.callcontext.aspx ). The documentation says something about
When reading about SQL I've come across the term 'slot'. For example, in a
I'm reading about the initialized values by default of an array/struct and have this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.