Re: c# Thread problem

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



On Wed, 04 Jul 2007 05:27:52 -0700, Jon Skeet [C# MVP] <skeet@xxxxxxxxx> wrote:

There don't have to be two explicit locks in the code though. Suppose
the update(gMsg) code included a call to Control.Invoke, and at the
time the UI was waiting to enqueue an extra message... that would
cause a deadlock, certainly.

And in fact, in my experience using Invoke() with a lock is the most common source of deadlock in .NET code. :)
.



Relevant Pages

  • Re: Am I using ThreadPool the right way?
    ... It is possible to debug deadlocks and other threading issues in the Express version, but it's not something I'd recommend for someone unfamiliar with the general techniques of dealing with thread issues in the first place, since Express doesn't provide any direct way to get at the individual threads in the debugger. ... You'll be looking for threads that are stopped on a statement that waits for some resource, to identify which threads are involved in the deadlock and why they are waiting. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Deadlock resolution
    ... > another thread (in the same workstation). ... > kernel performs a traceback on the chain of threads it is waiting ... If the chain doesn't break before the original thread is ... > reached again, deadlock is detected. ...
    (comp.lang.ada)
  • Re: [PATCH 13/12] ksm: fix munlock during exit_mmap deadlock
    ... just reintroduce the OOM deadlock that 9/12 was about solving. ... And it wouldn't be exactly the same deadlock, ... and hangs there waiting to acquire ksm_thread_mutex. ... If mm_users is allowed to go to 0, it's up to ksm ...
    (Linux-Kernel)
  • Re: Locking
    ... When this happens sql server automatically detects it and will ... So if your app is slow and waiting it is not ... > At the same time another stored proc is inserting data into the table,> updated fields, and deleting records. ... A deadlock> occurs, an the SQL box begins to get extremely slow. ...
    (microsoft.public.sqlserver.programming)
  • Re: Critical section ?
    ... James wrote: ... A deadlock is caused by thread A waiting for thread B to do something ... first is to send one thread to sleep on return, ...
    (alt.comp.lang.learn.c-cpp)