Re: [fpc-devel] threadvar vs docs

2024-10-18 Thread Sergei Gorelkin via fpc-devel
18.10.2024 16:21, Martin Frb via fpc-devel пишет: On 18/10/2024 14:30, Michael Van Canneyt via fpc-devel wrote: On Fri, 18 Oct 2024, Nikolay Nikolov via fpc-devel wrote: On 10/18/24 12:10 AM, Martin Frb via fpc-devel wrote: https://wiki.freepascal.org/Threadvar If threads are used then a c

Re: [fpc-devel] threadvar vs docs

2024-10-18 Thread Marco van de Voort via fpc-devel
Op 18-10-2024 om 15:46 schreef gabor via fpc-devel: Maybe variables containing managed types, such as dynamic arrays could be a problem in this case? "output" used to be a problem.  The contents (and pointers of the buffer in the textrec got duplicated

Re: [fpc-devel] threadvar vs docs

2024-10-18 Thread gabor via fpc-devel
W dniu 2024-10-18 o 15:27, Nikolay Nikolov via fpc-devel pisze: In C (with gcc) it's possible to give them initial value, other than 0: __thread int i = 5; But it doesn't seem to be supported by FPC for threadvars. And I don't know about Delphi. FPC's thread initialization does indeed include

Re: [fpc-devel] threadvar vs docs

2024-10-18 Thread Nikolay Nikolov via fpc-devel
On 10/18/24 4:21 PM, Martin Frb via fpc-devel wrote: On 18/10/2024 14:30, Michael Van Canneyt via fpc-devel wrote: On Fri, 18 Oct 2024, Nikolay Nikolov via fpc-devel wrote: On 10/18/24 12:10 AM, Martin Frb via fpc-devel wrote: https://wiki.freepascal.org/Threadvar If threads are used then

Re: [fpc-devel] threadvar vs docs

2024-10-18 Thread Martin Frb via fpc-devel
On 18/10/2024 14:30, Michael Van Canneyt via fpc-devel wrote: On Fri, 18 Oct 2024, Nikolay Nikolov via fpc-devel wrote: On 10/18/24 12:10 AM, Martin Frb via fpc-devel wrote: https://wiki.freepascal.org/Threadvar If threads are used then a copy is made for each thread (including the main th

Re: [fpc-devel] threadvar vs docs

2024-10-18 Thread Michael Van Canneyt via fpc-devel
On Fri, 18 Oct 2024, Nikolay Nikolov via fpc-devel wrote: On 10/18/24 12:10 AM, Martin Frb via fpc-devel wrote: https://wiki.freepascal.org/Threadvar If threads are used then a copy is made for each thread (including the main thread). Note that the copy is made with the original value of t

Re: [fpc-devel] threadvar vs docs

2024-10-17 Thread Nikolay Nikolov via fpc-devel
On 10/18/24 12:10 AM, Martin Frb via fpc-devel wrote: https://wiki.freepascal.org/Threadvar If threads are used then a copy is made for each thread (including the main thread). Note that the copy is made with the original value of the variable, not with the value of the variable at the time th

[fpc-devel] threadvar vs docs

2024-10-17 Thread Martin Frb via fpc-devel
https://wiki.freepascal.org/Threadvar If threads are used then a copy is made for each thread (including the main thread). Note that the copy is made with the original value of the variable, not with the value of the variable at the time the thread is started. But what is that original value