T Thraka Member Licensed User Longtime User Aug 12, 2014 #1 I was thinking of using a thread to do some work, and I wanted to use a callsub from it. Will the target of the callsub be fired on the newly created thread or on the main thread?
I was thinking of using a thread to do some work, and I wanted to use a callsub from it. Will the target of the callsub be fired on the newly created thread or on the main thread?
Erel B4X founder Staff member Licensed User Longtime User Aug 12, 2014 #2 How are you creating the new thread? What is it used for? CallSub (unlike CallSubDelayed) will be executed on the thread that called it. Upvote 0
How are you creating the new thread? What is it used for? CallSub (unlike CallSubDelayed) will be executed on the thread that called it.
T Thraka Member Licensed User Longtime User Aug 13, 2014 #3 I'm using a threading library from agraham. Actually what is going on is thee ICos weather library goes out and gets weather information when you set the city property. That can sometimes cause a delay, depending on your connection. This code is then reading the weather object and populating a global object with the current weather data. I then wanted to notify all listeners (UI classes) that new weather information has appeared and let them update. I just noticed the thread object has a Done event that I can use. Last edited: Aug 13, 2014 Upvote 0
I'm using a threading library from agraham. Actually what is going on is thee ICos weather library goes out and gets weather information when you set the city property. That can sometimes cause a delay, depending on your connection. This code is then reading the weather object and populating a global object with the current weather data. I then wanted to notify all listeners (UI classes) that new weather information has appeared and let them update. I just noticed the thread object has a Done event that I can use.