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 » Dealing with background tasks elegantly in a userinterface
Dealing with background tasks elegantly in a userinterface [message #58159] Fri, 04 March 2022 16:35 Go to previous message
Alboni is currently offline  Alboni
Messages: 214
Registered: January 2012
Location: Deventer, Netherlands
Experienced Member
Hello,

I wonder if there is an elegant way to execute tasks in the background. There are often MySql queries or http or rpc calls or other tasks that can potentially take more time than one can spend in a callback if you want a responsive userinterface.
How does one go about that in u++?

Some points:
Executing a query in the background and get a notification to the ui when it is done or failed and how much more time in between. Tasks over 5 seconds should be cancellable.
Do I have to open a MySqlSession for every query that is executed in the background?? Is this an "expensive" or slow thing to do or doesn't it matter.
Can I copy SqlSessions and use the copy in another thread concurrently with the original? DO I have to open it with credentials every time?
Cross thread communication with queues or pipes?
Using callbacks from threads?

About serializing tasks from other threads, is there an example for that?
I don't want to reinvent the wheel and get unreliable code. Done that too many times already.
I want the quick, easy and robust way. I'm missing the howto here, the overview. A reference is not enough.

(Yes, I've found Upp::Thread)


[Updated on: Fri, 04 March 2022 16:36]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: httprequest fails getting entire url content
Next Topic: Problem breaking loop (with close button) in main thread
Goto Forum:
  


Current Time: Wed Apr 24 16:41:19 CEST 2024

Total time taken to generate the page: 0.03265 seconds