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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:55:12+00:00 2026-06-04T20:55:12+00:00

Is it necessary to dispose off the Background Worker after I have done the

  • 0

Is it necessary to dispose off the Background Worker after I have done the processing work inside the DoWork event, or being a managed object this will automatically get disposed eventually?

Previously, I was performing some functions inside the timer_elapsed i.e to perform a task every thirty seconds.
Now, I am doing the same processing inside the BackGround Worker’s DoWork event. How do I loop this bgWorker event to be performed after every 30 seconds (say) bgworker.RunWorkerAsync();

If I put this bgWorker.RunWorkerAsync() indie timer_elapsed, how do I dispose it after every timer elapse?

  • 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-04T20:55:14+00:00Added an answer on June 4, 2026 at 8:55 pm

    Is it necessary to dispose off the Background Worker after …

    No. The BackgroundWorker does implement the IDisposable interface but only as a blanket feature inherited from Component. It serves no purpose.

    If I put this bgWorker.RunWorkerAsync() in timer_elapsed

    Doubtful if you should do that at all. But if you do, just create a new Backgroundworker each time.

    A Backgroundworker is a relatively ‘light’ object, it holds no resources. The thread is borrowed from the ThreadPool.

    If you are a stickler for principal, you may call Dispose() on the old one before creating a new one. But it won’t make much difference.

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

Sidebar

Related Questions

What references are necessary to have fluent nhibernate work with mysql. I have downloaded
It is necessary to disconnect from the database after the job is done in
How much work should be done in a Dispose method? In constructors I've always
Is it necessary to dispose of custom objects, even if they only contain managed
Is it necessary to check for nullptr after allocating an object using gcnew?
Is it necessary to close the connection of a tcplistener or tcpclient after every
Since C# uses Garbage Collection. When is it necessary to use .Dispose to free
I am currently rethinking the object dispose handling of the qooxdoo JavaScript framework. Have
Possible Duplicate: Does Dispose method still get called when Exception is thrown inside of
I have a few basic questions about the Dispose Pattern in C#. In the

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.