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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:22:09+00:00 2026-06-11T17:22:09+00:00

if i put things in c# TLS when does it get cleaned, or is

  • 0

if i put things in c# TLS when does it get cleaned, or is it my job to clean it?

I mean

a) will I always start with an empty TLS no matter how a thread starts a given piece of work (a QueueUserWorkItem thread , WCF invoked,…)

b) If I put expensive things in TLS will they be GC’d when the thread completes its work. Note I dont say ‘ends’ since I assume most .net threads come from one or more pools and so they don’t necessarily end as far as the OS is concerned. Or is it my job to always ‘finally’ myself to make sure I dont leave a mess behind me

  • 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-11T17:22:11+00:00Added an answer on June 11, 2026 at 5:22 pm

    TLS entries will survive a thread being placed back in the pool.

    So, in other words, it’s your responsibility to clean everything you put in the TLS if you are going to use threads from the System.Threading.ThreadPool class.

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

Sidebar

Related Questions

I can not make TextMate2 to get my PYTHONPATH. Things I tried: Put the
I put together this shell script to do two things: Change the delimiters in
I want to put a section in my site where people can upload things
Im trying to make a textarea where you put in a list of things,
I'm looking for some guidance here. On my site I put things in Web
I need to login to one development server to put things on live server.
To put things in context, I'm loading a list of items via Ajax, creating
I'm using the android designer in visual studio 2010, and I can put things
IN JSP i used to put things in bean's constructor which is in APPLCIATION
How do I write code such that I can put things in a set

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.