Tuesday 4 June 2019

Watching A Folder pt 2

A quick revisit to the Folder Watcher.

Due to the way Xojo handles threads, it appears that there is no need to yield the thread explicitly within this class.

I believe, but I may be wrong, this is because Xojo has the intelligence enough to yield to the next thread automatically when a loop is encountered. To be honest, I’m not sure, but I ran a test with the yield command commented out, and I experienced no lock up, the application remained responsive.

I have heard, from the Xojo forums, that Xojo does not use pre-emptive threads, so they have to explicitly cooperate with the other threads, but it appears that there is some contingency already coded into the Xojo language for this when using loops.