On 28.6.2007 20:04, Stefan Küng wrote:
> You're right. The reason for those global variables is to reduce disk
> access. Because of the many overlay handlers (one for each overlay
> icon), those global objects really improve the performance.
> One problem however with TLS is that we don't have all 'simple' data
> types but also complex objects.
> I think the best way to go here is to use critical sections to guard
> the global objects.
Well, we can create a simple structure holding all these globals and put
that in the TLS. If these globals has pointers to other types that's ok,
important is that every thread will have it's own structure with
variables and pointers. I don't think complex objects are a problem here
(apart from using more memory as every thread will have it's own copy).
I think important is to sort the globals by theirs use. Only variables
used for caching should be in the TLS, the rest is probably fine as
member variables or protected globals.
I will try to come up with a patch, but as I am leaving for a week, I
can't work on that now. If someone is thinking about doing it, feel free
Received on Thu Jun 28 20:34:14 2007