Threadvar
IOResult : Integer; |
If no threads are used, the variable behaves as an ordinary variable. 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.
Threadvars should be used sparingly: There is an overhead for retrieving or setting the variable's value. If possible at all, consider using local variables; they are always faster than thread variables.
Threads are not enabled by default. For more information about programming threads, see the chapter on threads in the Programmers guide.