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 » Thread calls GUI
Re: Thread calls GUI [message #20063 is a reply to message #20061] Sun, 15 February 2009 23:27 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Sami wrote on Sun, 15 February 2009 16:55

Thanks for your answer. It appears that this semaphore and additional function should be done for all interface calls... Have you considered fixing this apparent design issue in upp? Why we cannot have upp serialize (if it needs to) the gui calls transparently, so that there would be no limits for threads calling the gui?



Yes, it is planned.

Quote:


Additional question. Suppose we have a kill button in the GUI. void Task::KillButton(). How to kill the thread in this function? We presume the thread is heavy and cannot ping asking the interface for ShouldWeCancelNow() frequently enough to be able to shutdown itself.



I am afraid that killing the thread is not as easy as it might seem - who would free all associated resources?! (e.g. allocated memory, opened files and sockets...).

That is why I think that some form of "ShouldWeCancelNow" is in fact necessarry. It can take the form of periodic call to some function which in case of cancel throws exception - that IMO is the most effective way.

Mirek

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: StaticMutex/ONCELOCK question
Next Topic: GUI MT project does not compile
Goto Forum:
  


Current Time: Fri Apr 26 18:31:52 CEST 2024

Total time taken to generate the page: 0.02736 seconds