Login Page - Create Account

Support Board


Date/Time: Fri, 29 Nov 2024 08:43:24 +0000



Post From: persistent variables simultaneous assignments between charts? (across 2+ chart threads..)

[2023-03-02 17:22:53]
User133994 - Posts: 80
Thanks for the quick response. I understand that each instance operates in 1 thread from a "studies" perspective across *all* charts. I assume this is for all charts in the same chartbook.

So does
whatever chart sets a persistent variable last
mean this is impossible:

source chart #1 with source persistent variable A:
@1:00:00 uses sc.SetPersistent*ForChartStudy on variable A to set it to 34

destination chart #2 with reference to source's persistent variable A:
@1:00:00 uses sc.SetPersistent*ForChartStudy on variable A to set it to 100

And, does that mean that chart #1 will never "be able" to modify a shared persistent variable at the exact same time as chart #2? What is the sequencing mechanism for apparent "simultaneous" events? Who gets priority and why?

Will chart #2 be blocked from modifying the shared persistent variable, how, when? If they both request the sc.SetPersistent at the same time? Or is there a "queue" of requests and thus it will never be the exact same time. How does that queue work? A simple 2 chart 1 persistent shared variable example will be a great help in understanding this--if you are able.

Thanks in advance.

Follow-on question: What about different chartbooks--same thread also? Maybe there aren't shared persistent variables across chartbooks, even though it might be in the same thread?