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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:28:18+00:00 2026-05-13T22:28:18+00:00

I believe I have a potential threading issue. I have a user control that

  • 0

I believe I have a potential threading issue. I have a user control that contains the following code:

    private void btnVerify_Click(object sender, EventArgs e)
    {
        if (!backgroundWorkerVerify.IsBusy)
        {
            backgroundWorkerVerify.RunWorkerAsync();
        }
    }

  private void backgroundWorkerVerify_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
    {
        VerifyAppointments();
    }

  private void backgroundWorkerVerify_RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e)
    {

        MessageBox.Show("Information was Verified.", "Verify",
            MessageBoxButtons.OK, MessageBoxIcon.Information);
        CloseEvent();
    }

vanilla code. but the issue I have is that when the application is running and the users tabs to another application when they return to mine the application is hung, they get a blank screen and they have to kill it. This started when I put the threading code. Could I have some rogue threads out there? what is the best way to zero in a threading problem? The issue can’t be recreated on my machine…I know I must be missing something on how to dispose of a backgroundworker properly. Any thoughts are appreciated, Thanks,

Jose

  • 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-13T22:28:18+00:00Added an answer on May 13, 2026 at 10:28 pm

    Your code snippet doesn’t explain it, but deadlocking the UI thread is never that difficult when you use BGW and are interested in its IsBusy property. A deadlock like this is usually easy to diagnose, use Debug + Break All. Then Debug + Windows + Threads and double-click the Main Thread. Then Debug + Windows + Call Stack to see what the UI thread is doing.

    The common scenario is that the UI thread is looping on the IsBusy property. The BGW can’t complete because its RunWorkerCompleted event can’t run until the UI thread goes idle.

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

Sidebar

Related Questions

I believe that I have successfully impersonated my own user account while running an
I have the following situation: There is a windows folder that has been mounted
I am (unfortunately) developing an application in Excel 2000 VBA. I believe I have
I have what I believe is a killer idea for an application. By definition,
I believe several of us have already worked on a project where not only
I have been told and I'm not sure I believe this: Removing white space
I have two issues both related to (I believe) my SQL Server setup. I
I have an Oracle server (version 9, I believe) and a MS SQL server
As the questions says I have always believed that a strongly typed list is
I believe the application has some parts that target .NET, and some that don't.

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.