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++ Core » Threads and gui
Threads and gui [message #3575] Fri, 02 June 2006 12:58 Go to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Mirek please looke at the example attached to this post.

1. If you run the program and press the toolbar button the array control placed below it should be filled with 1000 rows. After that you can leave the program. Everything is fine.

2. Now if you move the mouse over the toolbar button and wait until tip shows and now if you press F5 (button shortcut) the array should be filled again but the button tip will stay and closing app will cause critical error.

I don't remember if upp gui is thread safe - anyway, is any solution for my problem?
Re: Threads and gui [message #3584 is a reply to message #3575] Sun, 04 June 2006 18:29 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13980
Registered: November 2005
Ultimate Member
unodgs wrote on Fri, 02 June 2006 06:58

Mirek please looke at the example attached to this post.

1. If you run the program and press the toolbar button the array control placed below it should be filled with 1000 rows. After that you can leave the program. Everything is fine.

2. Now if you move the mouse over the toolbar button and wait until tip shows and now if you press F5 (button shortcut) the array should be filled again but the button tip will stay and closing app will cause critical error.

I don't remember if upp gui is thread safe - anyway, is any solution for my problem?



No, GUI is not thread safe in sense that you could have more than single thread performing GUI operations.

Anyway, the solution is to use event queue which is synchronized (MT safe). See reference/GuiMT....

Mirek
Re: Threads and gui [message #3589 is a reply to message #3584] Sun, 04 June 2006 18:59 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13980
Registered: November 2005
Ultimate Member
BTW, nice explaining thread:

http://lists.trolltech.com/qt-interest/2005-03/thread00880-0 .html

(in other words, for X11, this is the best option...)

Mirek
Re: Threads and gui [message #3590 is a reply to message #3589] Sun, 04 June 2006 19:15 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Thanks! Just like I thought - just have to use postcallback. (Interesting is that calling gui routines from threads (in win32) works fine (at least in my app) execept these popups).
Re: Threads and gui [message #3591 is a reply to message #3590] Sun, 04 June 2006 21:33 Go to previous message
mirek is currently offline  mirek
Messages: 13980
Registered: November 2005
Ultimate Member
unodgs wrote on Sun, 04 June 2006 13:15

Thanks! Just like I thought - just have to use postcallback. (Interesting is that calling gui routines from threads (in win32) works fine (at least in my app) execept these popups).


Unpleasant thing about race conditions (and mutlithreding programming) is that they happen unpredictably... In some cases, once per month...

Mirek
Previous Topic: binar files in String
Next Topic: Small time thing:
Goto Forum:
  


Current Time: Thu May 16 20:02:02 CEST 2024

Total time taken to generate the page: 0.03013 seconds