So here is a major problem:
1. The app heavily relies on m.global and accesses it's fields from Task nodes
2. Recently I've discovered that
sometimes m.global fields are invalid (however returns valid objects when stopped in debugger)
3. As I have a solid programming background, I've guessed it is due to some threading issues and found this topic in docs https://sdkdocs.roku.com/display/sdkdoc/Scene+Graph+Threads#SceneGraphThreads-TaskNodeThreadRendezvousTimeout
Does it mean that m.global fields are not reliable to access from TaskNode at all???In my tests it could be as strange as follows:
myVar1 = m.global.someField ' myVar1 is invalid
myVar2 = m.global.someField ' myVar2 is ok
docs say: "
During application development, you should check for these timeouts to increase the performance of your published application."But I'd rather want it to lag, but be consistent.
Is there a way to avoid invalid responses when accessing m.global fields?Is there any global storage (accessible from any thread) that does not rely on render thread as m.global?I know, I can pass m.global state to GetGlobalAA() of task thread before running any TaskNode and add some business logic to get data from there, but I'm really tired of workarounds in my Scene Graph app.
And it is not an ideal solution, because each thread has it's own global AA and will require
syncing it with m.global when it changes, which is not that easy to implement if even possible to make it work properly at all.
Is it the one possible solution or am I missing something simple and obvious?