So, I've been wondering where exactly this magic thread storage comes from. Apparently it is just a symbol type that the thread subsystem will utilize to alloc on thread creation. That is super wacky, but is exactly what I wanted to know. Now I can write my lockless lock contention detector no problem.
__thread bool awesome = TRUE;
Using Thread Local Storage
http://docs.sun.com/app/docs/doc/817-1984/6mhm7pl2a?a=viewSTT_TLS in ELF files
http://blogs.sun.com/ali/entry/inside_elf_symbol_tablesThis could be complemented with symbol from pointer lookup via
dladdr()
http://linux.die.net/man/3/dlopen
No comments:
Post a Comment