Thread use

I have an issue with threads. My Web App has to collect and parse XML data from my video CDN using CURL. The performance of this action varies depending on the responsiveness of the CDN. Soo… I thread that action at session startup - hoping that my other app actions will be unhindered by this processing. However, my app is still caught and sluggish by the processing.

I know this because if I comment out that thread action, the web app is lighting fast. If I leave it in there, the app slowing to a crawl half the time.

So. Am I missing something about multi-threading?

Thanks in advance for any thoughts/help!

Are you running cURL form a Shell? Is it asynchronous? Even in a Thread, a long-running, synchronous Shell command will block the rest of your app.

Xojo threads are not preemptive. So a busy thread in hold, for some cause, could mean a frozen program due to the fact of Xojo threads not working in a “real” parallelism and thus not using extra cpu cores.

Thanks guys for the responses. I have decided to dump all my data from my CDN into my sql db from time to time and just have my app get what it needs from my own DB. The data doesn’t change super often. And I can have an admin sync the data manually from time to time.

This method allow the app to run at fast response without having to wait on servers I don’t control.