A thread private storage method performed in a digital data processing system of the type wherein one or more processing units and an addressable system memory are interconnected and are controlled by one or more sets of program instructions for compiling, linking, loading and executing a multi-threading process having multiple threads of execution which invoke and execute procedures that require one or more sets of initialization data, said thread private storage method comprising:
- controlling the processing units and addressable system memory with the one or more sets of program instructions during the operation of said system for compiling, linking and loading said multi-threading process to perform the following steps for each thread of said multiple threads of execution:
- (a) establishing and storing in system memory a template for each said set of initialization data, each said template being associated with a different set of initialization data, each said template including data identical to its associated set of initialization data;
- (b) establishing for each said template an associated descriptor for use in subsequent creation of a copy of said initialization data that is private to each said thread that executes one or more procedures that require the initialization data associated with said template, said descriptor uniquely identifying the template with which it is associated and including information that allows the processing units to locate said template uniquely identified by said descriptor in said system memory at the time of said subsequent creation of said copy of said initialization data;
- (c) establishing a sequence of coded instructions for locating said template uniquely identified by said descriptor;
- (d) including said sequence of coded instructions in said one or more set of program instructions for controlling said processing units and said addressable system memory;
- and,
- controlling the processing units and system memory with the one or more sets of program instructions during execution of said procedure executed by each said thread to perform the steps of:
- (a) creating said copy of said initialization data that is private to each said thread by copying into system memory a copy of the set of initialization data required by the procedure, said step of creating said copy being performed at the first point of execution at which said initialization data is required for further execution of said procedure, said copying into system memory being effected by accessing system memory by means of said descriptor that uniquely identifies the template associated with said required set of initialization data to locate the template associated with said required set of initialization data and by copying said initialization data of said template to an available previously unspecified system memory address.