Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » DnD hangs in MT Refresh()ing
Re: DnD hangs in MT Refresh()ing [message #24877 is a reply to message #24848] Tue, 02 February 2010 19:15 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13976
Registered: November 2005
Ultimate Member
kohait00 wrote on Mon, 01 February 2010 08:52

hi mirek, just to be sure:

in Win32Wnd
in Create0 and ProcessEvent
you put and left a
ASSERT(IsMainThread());
..

is that really nesseccary? cause there might be cases where another thread starts to execute a dialog, or shouldnt that happen (because thats bad design, good would be gui = main thread)

cheers


I believe it is ok - another thread can never execute a dialog DIRECTLY.

See explanation above - it is because all messages are associated with a thread that created the window (by Win32). That is the reason we need all that stupid machinery of "calling to the main thread" - if non-main thread wants to create a window, it is done by Call or ICall -> this puts the request for the main thread, which, when idle (event queue empty), adopts a request and performs it. Non-main thread waits blocked by semaphor, main thread releases the semaphor when request finished. That way, all windows are created by the main thread and all message loops are performed by the main thread too...

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: MT with speed optimization fails
Next Topic: what about WorkQueue : public CoWork
Goto Forum:
  


Current Time: Fri May 10 13:26:36 CEST 2024

Total time taken to generate the page: 0.03627 seconds