Dynamically allocated thread-local storage
AssigneeMicrosoft Technology Licensing, LLC
InventorsIgor Ostrovsky, Joseph E. Hoag, Stephen H. Toub, Mike Liddell
Life of this patent
Estimating the term…
Abstract
Dynamically allocated thread storage in a computing device is disclosed. The dynamically allocated thread storage is configured to work with a process including two or more threads. Each thread includes a statically allocated thread-local slot configured to store a table. Each table is configured to include a table slot corresponding with a dynamically allocated thread-local value. A dynamically allocated thread-local instance corresponds with the table slot.
Claims20
A dynamically allocated thread storage in a computing device having a memory, comprising:
- a plurality of threads included in the memory, wherein each thread includes a statically allocated thread-local slot defined in source code, the thread-local slots each having a table including a plurality of table slots each configured to store a respective thread local value for a particular thread-local variable within the same slot position for each of the plurality of tables;
- and
- a dynamically allocated thread-local instance configured in the memory, the dynamically allocated thread-local instance contains a linked list of allocated thread local slots within the same position of the plurality of tables of the thread local slots and represents the respective values associated with a particular thread local variable, wherein the dynamically allocated thread-local instance is dynamically released during runtime and when the instance is released, indicating the allocated thread local table slot associated with the linked list for removal while preserving the value for other threads of the plurality of threads.
A method of dynamically allocating thread storage in a computing device having a memory, the method comprising:
- processing a plurality of threads included in the memory, wherein each thread includes a statically allocated thread-local slot defined in source code, the thread-local slots each having a table including a plurality of table slots each configured to store a respective thread local value for a particular thread-local variable within the same slot position for each of the plurality of tables
- generating a dynamically allocated thread-local instance configured in the memory, the dynamically allocated thread-local instance contains a linked list of allocated thread local slots within the same position of the plurality of tables of the thread local slots and represents the respective values associated with a particular thread local variable;
- and
- releasing the dynamically allocated thread-local instance during runtime and when the instance is released, indicating the allocated thread local table slot associated with the linked list for removal while preserving the value for other threads of the plurality of threads.
A computer readable storage medium, which does not include transitory propagating signals, storing a platform including computer executable instructions for controlling a computing device, the platform configured to perform a method comprising:
- processing a plurality of threads wherein each thread includes a statically allocated thread-local slot defined in a source code, the thread-local slots each having a table including a plurality of table slots each configured to store a respective thread-local value for a particular thread-local variable within the same slot position for each of the plurality of tables;
- generating a dynamically allocated thread-local instance containing a linked list of allocated thread local slots with the same position of the plurality of tables of the thread local variable;
- and
- releasing the dynamically allocated thread-local instance during runtime and the when the instance is released, indicating the allocated thread-local table slot associated with the linked list for removal while preserving the value for other threads of the plurality of threads.
Dependencies are inferred from the claim text.