
28 Jul
2004
28 Jul
'04
9:11 a.m.
Bronek Kozicki wrote:
Vladimir Prus wrote:
It looks like your global table indexed by thread ID is just reinvention of TSS, which is guaranteed to be slower.
And, BTW, you can't have simple vector indexed by thread id -- because in NTPL thread ids do not start with zero. So you'd need std::map, which might be really slow, or some custom map, which doesn't exist yet.
I'd rather waste someting like 64KB memory and make it simple and fast table of pointers.
64KB? We had a code which worked by creating such table, and after upgrade to NPTL is started throwing "out of memory" errors when resizing this table -- on a 2GB box. The thread ids can be very large values with NPTL, so you *need* either map or some hashing. - Volodya