On that note, please be aware that each thread has its own tcl interpreter, and therefore there is no guarantee that a global will persist from one call to another! (depedending on re-use of threads etc)
I suspect this may be your problem... perhaps you need to consider using an alternative storage method.