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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:44:50+00:00 2026-06-05T01:44:50+00:00

slowly I’m overworked… I have a huge application with threading, timers, invoke (not BeginInvoke,

  • 0

slowly I’m overworked…

I have a huge application with threading, timers, invoke (not BeginInvoke, so it is synchronous) and Application.DoEvents.

It is too much to post here and I don’t know where the problem really is.

Every Method of mine is inside a try catch. Every catch is logged.

If I start my application from Visual Studio (F5) or while profiling it via Ants there is no Problem. The Application runs since some days.
But as soon as I start the same debug version via windows explorer it freezes every few hours. It freezes without any exception or so.
If I attach visual studio to this application and break it, it stops on Application.Run(new Form1());

I’m really confused and have no idea to repair it.

It is a .net 3.5 winforms application

It looks like one thread hangs here:

if (grabber.InvokeRequired)
{
    Console.WriteLine("grabber.InvokeRequired");
    this.Invoke((MethodInvoker) delegate { grabber.Navigate("http://www.google.de"); }); // <-- hang
}
else
{
    grabber.Navigate(ig.StartUrl);
}

this snippet is part of an timer event

_timeout = new System.Timers.Timer(10000);
_timeout.Elapsed += new ElapsedEventHandler(OnWatchDogBark);

Edit

A sample for DoEvents(). This is in a lock() and in an invoke

grabber.DocumentCompleted -= grabber_DocumentCompleted;
grabber.Navigate("http://www.google.de");

while (grabber.ReadyState != WebBrowserReadyState.Complete)
{
    timeout--;
    Application.DoEvents();
    Thread.Sleep(200);

    if (timeout < 0)
    {
        timeout = 50;
        grabber.Navigate("http://www.google.de");
    }
}

Currently I use the System.Windows.Forms.Timer and some locks but there is no improvement.

Okay I used WinDbg to get some informations

Edit: 14.06.2012

!threads

                                      PreEmptive   GC Alloc           Lock
       ID OSID ThreadOBJ    State     GC       Context       Domain   Count APT Exception
   0    1 37ec 007cab18      6020 Enabled  00000000:00000000 007c8510     0 STA System.ArgumentException (02762ba8)
   2    2 85b8 007d7c38      b220 Enabled  00000000:00000000 007c8510     0 MTA (Finalizer)
XXXX    3    0 06e9f548      9820 Enabled  00000000:00000000 007c8510     0 Ukn
  21    5 3464 0d6dc598   200b020 Enabled  28cb5820:28cb5fe8 007c8510     0 MTA
  22    6 62b0 0d6db9e0   200b220 Enabled  00000000:00000000 007c8510     0 MTA
  23    7 8e58 0d6db5f8    80a220 Enabled  00000000:00000000 007c8510     0 MTA (Threadpool Completion Port)
XXXX    4    0 06f62d40   1801820 Enabled  00000000:00000000 007c8510     0 Ukn (Threadpool Worker)
XXXX    f    0 132a3290   1801820 Enabled  00000000:00000000 007c8510     0 Ukn (Threadpool Worker)
XXXX   10    0 132a3678   1801820 Enabled  00000000:00000000 007c8510     0 Ukn (Threadpool Worker)
XXXX    e    0 132a26d8   1801820 Enabled  00000000:00000000 007c8510     0 Ukn (Threadpool Worker)
XXXX    9    0 0d6db210   1801820 Enabled  00000000:00000000 007c8510     0 Ukn (Threadpool Worker)

!dlk

Examining SyncBlocks...
Scanning for ReaderWriterLock instances...
Scanning for holders of ReaderWriterLock locks...
Scanning for ReaderWriterLockSlim instances...
Scanning for holders of ReaderWriterLockSlim locks...
Examining CriticalSections...
Could not find symbol ntdll!RtlCriticalSectionList.
No deadlocks detected.
  • 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-05T01:44:51+00:00Added an answer on June 5, 2026 at 1:44 am

    Could be a possible Deadlock in a background thread.
    Try looking at other threads that could block your app.

    Toolbar -> Debug -> Windows -> Threads
    

    http://msdn.microsoft.com/en-us/library/w15yf86f.aspx

    There should be multiple threads and if you double click one you see the line where it is stopping your app.

    And if you this line in your code:

    Control.CheckForIllegalCrossThreadCalls = false;
    

    Set it to true again. A possible cause for dead locks are background thread accessing controls.

    Instead of writing this from a backgroud threads.

    button1.Text = "hello"
    

    write this.

    this.Invoke(() => button1.Text = "hello");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a few divs that follow the mouse position slowly. In the begenning
I'm a Flash developer but have been slowly moving to developing my applications in
I've got a web application that's running really slowly and occasionally hanging. It's a
I have been slowly learning iPhone development and seem to keep hitting walls where
I am slowly learning Python and thumbing through the tutorials. I feel I have
I have a slowly growing collection of about 3 million tagged documents and I
new guy here and I'm slowly getting the hang of python, but I have
I'm slowly working through the iPhone Application Programming Guide and although it's been great
I have been learning (slowly but surely) how to do deal with sqlite databases
I have a script that is running slowly and I was wondering how I

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.