TIP #134: Subsystem Per-Thread Data Interfaces
_____________________________________________________________________________
TIP:	134
Title:	Subsystem Per-Thread Data Interfaces
Version:	$Revision: 1.4 $
Authors:	Colin McCormack <colin@sharedtech.dyndns.org>
State:	Withdrawn
Type:	Project
Tcl-Version:	8.5
Vote:	Pending
Created:	Mon May 12 00:00:00 UTC 2003
Abstract
Tcl core subsystems per-thread data is good, because it modularises the core. None of the structures or access keys are exported, which is bad, because it makes modification to these subsystems difficult in a CVS world.
Rationale
If one wishes to track the CVS while writing modifications to core subsystems one needs to minimally impact the existing source files while adding or changing subsystem functionality. Since most subsystem global state is kept in Thread Specific Data, and access to this state is necessary for subsystem modifications, providing an interface would ease coding at the core subsystem level. Modular encapsulation would be preserved by conditionally compiling API elements useful only to subsystem development and not intended for extension development.
Justification
The degree of modularity of the core would remain unchanged, access to subsystem TSD would presumably only be used for subsystem development, but would enable that development to proceed more easily - one could extend subsystems as easily as one currently writes extensions. I think the degree of potential abuse is likely to be low.
Outline of Proposal
Each Thread Specific Data structure should be named uniquely for each subsystem.
Each subsystem should have its own .h header file
Each subsystem should export a function like tclTSD<subsystem> returning pointer to its TSD. This API should be conditionally compiled, so that it's clear that it's not available to normal extensions.
Implementation
The implementation of this TIP is trivial.
Copyright
This document has been placed in the public domain.
_____________________________________________________________________________
Colophon
TIP AutoGenerator - written by Donal K. Fellows