The game freezes while searching the database #1616
-
How to implement the program working while searching the database? It's supposed to be a very long search, but during it the application freezes and even crashed a couple of times if you try to press something. Use multithreading? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Exactly that. When the worker thread is ready to send data back to the main thread, then use the |
Beta Was this translation helpful? Give feedback.
-
If it's "freezing" because it is performing some task that requires waiting for a result (I/O, DB access, etc.), then you really can't get around the fact that you need to do that in a separate thread if you want the UI (on main thread) to still be responsive. As for why it's crashing, I don't know; are you certain there isn't a bug in your code? |
Beta Was this translation helpful? Give feedback.
Exactly that. When the worker thread is ready to send data back to the main thread, then use the
Scheduler::runOnAxmolThread()
for that.