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

  • Home
  • SEARCH
  • 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 6024537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:10:12+00:00 2026-05-23T04:10:12+00:00

I have a VB.net project which uses a background worker to do some stuff.

  • 0

I have a VB.net project which uses a background worker to do some stuff.

Now I want to expand the project to be able to do multiple stuff 🙂

A user can enter an URL in a textbox and when the user click on the parse button the program creates a new tabcontrol a outputs some data.

I use a hardcoded background worker for this.

But now I want to run multiple background workers to do this stuff so I can’t rely on hard coding the background worker(s).

Is it possible to create background workers dynamically.

I just don’t have any idea how to set this up since I think I need to set up the different methods and variables like:

Private bw As BackgroundWorker = New BackgroundWorker
bw.WorkerReportsProgress = True
bw.WorkerSupportsCancellation = True
AddHandler bw.DoWork, AddressOf bw_DoWork
AddHandler bw.ProgressChanged, AddressOf bw_ProgressChanged
AddHandler bw.RunWorkerCompleted, AddressOf bw_RunWorkerCompleted
bw.RunWorkerAsync()

Private Sub bw_DoWork(), Private Sub bw_RunWorkerCompleted() and Private Sub bw_ProgressChanged()

I think I need to declare the background workers in some sort of array like variable (list / dictionary)??? Other then that I have no idea how to tackle this.

  • 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-23T04:10:13+00:00Added an answer on May 23, 2026 at 4:10 am

    Although BackgroundWorkers can be the best, simplest, and smartest way to multithread sometimes, I think you might now look to use one of the other ways to multithread.

    There are lots of debates/arguments/trolling regarding which methods are the best to use in each circumstance, so my advice to you would be to have a quick look at the following articles and decide for yourself (or if you can’t find good enough resources to make a decision, ask on SO of course).

    You’ve obviously looked at back ground workers already so I won’t list them, nor will I list all the ways you can thread, just a couple that might be of interest to you.

    First off, check out the ThreadPool. It’s easy to use, and it makes fairly good use of recycling/re-using resources. There are some cons such as using/holding too many threads from a pool can exhuast the pool, but in simple applications that shouldn’t be an issue.

    There is also the CLR Async model which is supported across a suprising amount of the framework itself, particularly in cases involving some form of IO resource (file, network, etc).

    Another approach is the Parallel Class which is one of my favourites – I’ve been hooked on multiline lambda since it was introduced and parallel provides a good platform for doing so.

    In all of the above cases, you can create tertiary threads on the fly, without having to create and maintain a pool of background workers yourself. It’s hard to say which approach would work best for you from the information provided, but personally, I’d consider the threadpool if retrieval of the data to populate your tabs doesn’t take too long.

    Hope that helps!

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

Sidebar

Related Questions

I have a .Net project which uses the MySQL connector which is located in
I have Visual Studio .Net project which uses ADO connection to call stored procedure
I have a .NET project which references another assembly that is built outside of
I have created a a subclass of Table in my ASP.NET project which creates.
I have a ASP.NET project, in which I have a method with 10 local
I have a CC.NET project configured to call a common NAnt build file, which
I have a .net 1.1 project in VS.Net 2003 (using C#) in which I
I have a .net project (MySolution.Common) that uses the app.config. I am using the
I have a vs.net project, and after some refactoring, have modified the name of
I have a .net interop project that uses an app.config file. When I am

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.