Version 0 of Thread Specific Data

Updated 2003-05-12 01:24:45

(this can be used for general discussion of per-thread data)


CMcC Each of the following tcl core subsystems contains Thread Specific Data:

  • tclFileName
  • tclIO
  • tclNotify
  • tclAsync
  • tclEvent
  • tclTimer
  • and even tclRegexp

It's used, somewhat like ClientData, to store per-thread quasi-global arbitrary data, which is required to maintain state, and used to clean up on termination or Finalization as it is called in the tcl core

This is useful, because it helps modularise each subsystem, however the very encapsulation makes it impossible to extend or modify the subsystems additively, which would make it easier to test subsystem mods without pulling apart entire subsystems.

I'm writing a TIP on this subject.