Re: SendMessage (in secondary thread) freezes application GUI thre

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



Did you try the suggestion I made earlier?

Does the UI thread ever do a Wait (or other blocking call)? Any
chance it doesn't come out of that wait (i.e. what circumstances
would cause it to wait forever)?

You could try setting a flag just before waiting and then clearing
after the
wait. Then, in the non-UI thread, check the flag. If the flag is
set,
throw up a MessageBox. Then attach the debugger to the program and
get some stack traces.

--
Michael Salamone [eMVP]
Entrek Software, Inc.
www.entrek.com


"skyapie" <skyapie@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:23E99DE6-7FDA-4A69-9EE4-808D48D4C3D5@xxxxxxxxxxxxxxxx
Thanks for that Paul.

Now I just got to figure out which message getting processed is the one
causing the deadlock.... (any clues as to how to do this?)

Thanks :)


"Paul G. Tobey [eMVP]" wrote:

One or the other will win and that message will end up in the queue
first,
will, presumably, be handled first by the third thread, and that
application
will be released first. Then the next message will be at the top of the
queue and, again, the third thread will process that.

What's the question? If the system is about to go into suspend mode, it
will probably suspend before the about-to-suspend message gets to the UI
thread. When the device resumes, that message will still be there...

Paul T.

"skyapie" <skyapie@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BB5466B6-F02A-4F1E-9285-9B230BFD58F7@xxxxxxxxxxxxxxxx
Hi guys, me again... =)

I have a question... what happens if there are 3 threads, and 2 threads
simultaneously do a "SendMessage" to the third one?

Plus, what if Thread A is actually sending a message to the UI thread,
saying that it has received a Power Broadcast message, and that the
system
was about to go into suspend mode... and the UI thread was in the
middle
of
processing Thread B's message?

Thanks...


.



Relevant Pages

  • Re: SendMessage (in secondary thread) freezes application GUI thre
    ... power left, the application stopped hanging... ... Then, in the non-UI thread, check the flag. ... queue and, again, the third thread will process that. ... will probably suspend before the about-to-suspend message gets to the UI ...
    (microsoft.public.windowsce.app.development)
  • [PATCH 2/5] Container Freezer: Make refrigerator always available
    ... The refrigerator() can now be used in a control group subsystem ... The PF_FREEZER_SKIP flag should be set by a vfork parent right before it ... +static inline void frozen_process ... config SUSPEND ...
    (Linux-Kernel)
  • Re: Wait for flag
    ... > just loop until the flag is set or a time out reached, ... Post a message to fire a message-handler event. ... > although you can suspend threads you have created yourself, ... Two computers? ...
    (borland.public.delphi.language.objectpascal)
  • Re: [PATCH] pata_sil680 suspend/resume
    ... Jeff submitted the respective cumulative libata patch last ... ATA_DFLAG_SUSPENDED flag? ... "disk" be suspended before the host and is it when the eh should set the ... Shall I suspend it explicitely from userspace? ...
    (Linux-Kernel)