<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2017-03-17 5:50 GMT-03:00 Michael Schnell <span dir="ltr"><<a href="mailto:mschnell@lumino.de" target="_blank">mschnell@lumino.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 16.03.2017 19:38, African Wild Dog wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I have a class where its instances are shared between multiple threads.<br>
How can I declare one variable per instance per thread?<br>
</blockquote></span>
Does this really make sense ?<br>
<br>
Accessing threadvars (in fpc) costs a lot more CPU cycles (i.e. involves an OS call) than accessing normal variables.<br>
<br>
Supposedly the way to go is to do per-thread instances of a class, that might reference the other classes you want to instantiate.<span class="HOEnZb"><font color="#888888"><br>
<br></font></span></blockquote><div><br></div></div>I have huge collection of objects (abot 1 million) in memory so if i go with per-thread instance it will consume the entire memory ram.<br></div><div class="gmail_extra">I will have to redesign my classes =(.<br></div></div>