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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:28:32+00:00 2026-06-12T05:28:32+00:00

I am very new to threading in .NET and have limited exposure to threading

  • 0

I am very new to threading in .NET and have limited exposure to threading in Java. In short, I have a form that has a System.Windows.Forms.Timer object. The Timer ticks every 1000ms. The event handler merely checks a bool class variable (i.e. processingResponseFiles) to determine whether or not a current operation to process request files is in process. If not in progress, it should process any request files. Otherwise, it should do nothing.

The ProcessRequestFiles method looks at the request and then runs a BackgroundWorker to perform the work. The issue that I am struggling with is that the value of processingResponseFiles is always false even though I am assigning it to true in the first statement of the ProcessingRequestFiles method. Can someone please tell me why the value of processingResponseFiles is always false even though I am setting it in the ProcessRequestFile() method?

I need to protect this method so that it does not get executed more than once.

private void timerRequestTimer_Tick(object sender, EventArgs e)
{
    if (!processingResponseFiles)
    {
        ProcessRequestFile();                
    }

private void ProcessRequestFile()
{
    processingResponseFiles = true;

   // Process Request Files
   // If request type is Synchronize Customers
   // Run thread that synchronizes customers
   // If request type is Synchronize Items
   // Run thread that synchronizes items

   processingResponseFiles = false;
}
  • 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-12T05:28:33+00:00Added an answer on June 12, 2026 at 5:28 am

    It isn’t very clear, too much stuff commented out, but clearly the flag needs to be reset back to false in the BackgroundWorker.RunWorkerCompleted event handler. Only then do you know that the job was completed. Or just use the BackgroundWorker.IsBusy property.

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

Sidebar

Related Questions

I have a WPF (C# and .NET 4) application that has a long running
I'm working on a windows forms application (.NET 4.0). My form contains a 'Fast
Let's say I have a collection of System.Threading.Tasks.Task : HashSet<Task> myTasks = new HashSet<Task>();
I am very new to threading, as a beginner in C#. I have a
I'm very new to threading and thus am not quite sure if this even
Very new to python and can't understand why this isn't working. I have a
Very new to XSL (and XML for that matter), but I need to step
Im very new in C++ I have found this post http://msdn.microsoft.com/en-us/magazine/cc163486.aspx and trying to
I have an ASP.NET app, very basic, but right now too much code to
I'm very new to Python and multithreaded programming in general. Basically, I have 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.