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 369391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:54:55+00:00 2026-05-12T13:54:55+00:00

If I set the CurrentCulture of a thread pool thread, what happens when the

  • 0

If I set the CurrentCulture of a thread pool thread, what happens when the thread finishes execution and gets returned back to the thread pool? Does it get its CurrentCulture reset back to the default (whatever that may mean), or will it retain the culture I have set on it?

I’m hoping that the framework resets the thread to a default state to guard against this, but cannot find any documentation to this effect. The closest I have found is from the MSDN docs for ThreadPool:

When the thread pool reuses a thread,
it does not clear the data in thread
local storage or in fields that are
marked with the ThreadStaticAttribute
attribute. Therefore, data that is
placed in thread local storage by one
method can be exposed to any other
method that is executed by the same
thread pool thread.

This seems to indicate that the thread is not reset when it is returned.

I have tried some sample code to try to test this, and it does seem that the culture is reset, but I am not convinced that I am testing this behaviour correctly as I think I am only using a small subset of the ThreadPool’s threads, and so cannot be sure I’m testing a thread that has already had it’s culture set.

  • 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-05-12T13:54:55+00:00Added an answer on May 12, 2026 at 1:54 pm

    I would not rely on the ThreadPool ever resetting information, specifically because of the text you quoted.

    If you are worried about “changing” the thread pool’s culture, I would make sure to reset it when your threaded task is complete. This is a simple enough task.

    I do not believe the current threadpool does this, but even if it did, it would not be safe to assume that .NET 4+’s ThreadPool implementation will not change.

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

Sidebar

Related Questions

When we set the CurrentCulture and/or CurrentUICulture we do this on the current thread
i have set culture in Action Filer as Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture);
I'm trying to set LongTimePattern property of CurrentCulture with the following code: System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.LongTimePattern =
Is there any PowerShell equivalent for: Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; ? Or how to set
Does anyone know in ASP.Net how to get the language of the currentculture without
I set the culture to Hungarian language, and Chr() seems to be broken. System.Threading.Thread.CurrentThread.CurrentCulture
I want to set the value of Thread.CurrentCulture based on some route data, but
The active language is determined from the url and then set on the Thread.CurrentThread.CurrentUICulture
Is it possible to find user's culture if I cannot use Thread.CurrentCulture nor (naturally)
The recommended best practice is to set the current culture of the application's thread

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.