Talk:OpenMP support
From Lazarus wiki
Jump to navigationJump to search
IMHO the discussion about the value of threadvar count does not make much sense.
Each thread has it's own threadvar instance.
Thus before and after the "parallel" section there is one. Within the parallel section this "mainthread" instance still exists and each of the some_value new threads gets it's own. So there are some_value+1 of them. Those used in the "loop" don't have an initial value so they are undefined (thus the "loop" does not do any sensible work).
After the parallel section the only remaining variable still has it's initial value of 0.
Mschnell 15:54, 4 December 2007 (CET)