Page 1 of 1

Threaded persistence?

Posted: Thu Oct 22, 2009 8:09 am
by Marlin
I just stumbled upon this new keyword "Threaded".
Help wrote:Threaded allows to create a thread based persistent variable, arrays, linkedlists or maps. That means than every thread will have its own version of the object.
As far as I understood it yet, this allows globally visible variables... with individual content for each thread.
So I could use it in procedures called by threads, without the need to put it in the parameter list.
(In contrast to variables declared in the thread procedure)
Also there is one version for the main process.

What I did not quite understand yet, is how there could be any use or availability of "persistence",
after a thread has ended.
Is this persistence only meant for the main process itself?
(where this variable... is also visible with an individual value)

Are there any other special properties to the "Threaded" approach?

Re: Threaded persistence?

Posted: Thu Oct 22, 2009 8:32 am
by freak
The data is destroyed once the thread ends.

"persistent" is the wrong term here because it has a special meaning in computer science ("persistent" as in "on a stable storage device") compared to its general language use.

Re: Threaded persistence?

Posted: Thu Oct 22, 2009 9:04 am
by Marlin
Thank you freak.

I was assuming, there could have been meant some kind of persistence like the static keyword gives.

Maybe the word "persistent" should be deleted at that point in the help file.
(It is mentioned anyhow that those variables... do have global scope.
That makes it clear, that the version for the main process will not be lost
until the program ends.)