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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:14:51+00:00 2026-05-26T00:14:51+00:00

I want to perform several tasks (Disk IO on Remote Shares) at the same

  • 0

I want to perform several tasks (Disk IO on Remote Shares) at the same time. I do not want to block the UI. I think I need to create a custom class that does the following…

  • Accepts and queues a request (using a Stack)
  • Checks the thread pool and if a thread is available starts it with the requested info
  • As each thread completes check the stack for pending requests…

Is there a better way to do this?

Is there a class already available for this?

Should I use a pool of the BackgroundWorker class or something else?

Will I have to implement the BackgroundWorker class in a custom class so that I can create multiple threads?

I want to create up to 8 threads for deleting files and folders. I need to query the number of items on the stack for updating the UI.

I currently have the code working with a single BackgroundWorker thread to delete the files and folders (which keeps the UI from locking, but it takes so long I tend to run several of the utilities at the same time).

Thanks,
Lee

  • 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-26T00:14:51+00:00Added an answer on May 26, 2026 at 12:14 am

    If you’re using .NET 4, then the Task Parallel Library looks like exactly what you need. Reference on MSDN is here: http://msdn.microsoft.com/en-us/library/dd460717.aspx .

    Specifically, the example at http://msdn.microsoft.com/en-us/library/dd537608.aspx suggests replacing

    foreach (var item in sourceCollection)
    {
        Process(item);
    }
    

    with

    Parallel.ForEach(sourceCollection, item => Process(item));
    

    Just be wary of deadlocks in your code; in paricular, test extensively, as there can be strange things that happen sometimes in the depths of the Windows networking stack.

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

Sidebar

Related Questions

I want to perform the same action over several objects stored in a NSSet
It seems that every time I want to perform a db query, I have
What do I want to achieve: I want to perform some time consuming operations
I have several objects on a page and I want to perform an operation
I want to perform several actions when a User successfully logs in to my
I want to write a test that perform Setup in several ways but expect
I need to perform several operations on a list of windows (minimize some of
I have a secure/ sub-directory with several files that I want to perform some
I want to perform the title-named action under linux command-line(several ca bash script will
I need to perform several action on a html file such as removing a

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.