Does the UI thread ever wait for any locks? Is it possible it's waiting for
the background thread to release some resource?

Tobias Selwood
----- Original Message -----
From: "Ross Diesel" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, April 12, 2005 8:32 AM
Subject: [ADVANCED-DOTNET] UI thread problems


Hi

I'm struggling with what appears to be deadlock/UI thread marshall
failure.

The main application thread creates a UI synchronization object (UiSync)
on
startup and thereafter spawns a background thread (listener - not a pooled
thread) which is given access to UiSync.

UiSync supports ISynchronizeInvoke by inheriting from
System.Windows.Forms.Form.

The background thread uses the UiSync object to create and launch a
modeless
form. In the case of our product though, both the main form and the newly
launched form cease to respond to user input. In various other test
harnesses both the test harness application form and the UiSync launched
form remain responsive to user input. In the case of product the listener
thread remains responsive to message queue receives.

Further, in the case of our product, we are spawning session threads from
our background thread on receipt of certain messages. These session
threads
are responsable for invoking UI functionality (web browser control
creation
and parenting) using the UiSync object. When the backgrond thread receives
and processes the first start session request, the UiSync.Invoke is
executed
and the application deadlocks and all ui is frozen.

I have developed a number of test harness varying in complexity (wrt the
background processing) but these test harnesses all fail to reproduce the
deadlock/marshalling problem in our product when UiSync.Invoke is
executed.
UiSync.InvokeRequired is checked (and returns true) prior to execution of
the Invoke in the test harnesses and the product.

Pausing the VS debugger and examining the process threads provides no
thread
status clues.

Any suggestions as to the probable cause or to more sophisticated
tools/techniques for debugging this kind of problem would be most
appreciated.

regards

===================================
This list is hosted by DevelopMentor�  http://www.develop.com

View archives and manage your subscription(s) at
http://discuss.develop.com




=================================== This list is hosted by DevelopMentor� http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to