ofThread use question

I request to access the data of the database every once in a while in the thread, why does the interface in the main thread get stuck, and how to solve it?

Hi, threading can be a real pain in the ass if not handled properly.
It might be that your thread is blocking while waiting, thus blocking the main thread.

How do you access the data base? if you do by an http query you might want to try out ofLoadURLAsync(...). Look at the example in examples/input_output/imageLoaderWebExample as a reference on how to use it.

Alternatively you can use an ofThreadChannel. look at its example in examples/threads/threadChannelExample

as well if none works you can try @bakercp 's excelent addon ofxHttp

1 Like

Thank you very much for letting me use ofLoadURLAsync(…) to solve the problem, thank you!