Browse Prior Art Database

Transparent access algorithm for multistate object graph based on thread local storage Disclosure Number: IPCOM000243017D
Publication Date: 2015-Sep-09
Document File: 4 page(s) / 107K

Publishing Venue

The Prior Art Database


Accessing a graph of objects that can operate in multiple states requires a transparent and easy to use algorithm. In this solution, when the state of an object is requested, it is retrieved from the thread local storage mechanism.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 49% of the total text.

Page 01 of 4

Transparent access algorithm for multistate object graph based on thread local storage

Disclosed is a solution for accessing the graph of multistate objects on the basis of the thread local storage mechanism.


An object (service) can operate in a predefined set of states S = S_1, S_2, ..., S_N. Each state provides additional background information (or metadata) to help fine-tune the service behavior in certain cirmustances. The object provides a public interface for performing its operations, but the exact operation outcome also depends on the current object state S_x in S. The object can be composite, for example its operations can return references to other objects (instances) that also operate in the same set of states

A full client api can consist of a graph of multistate objects that it can access . These objects are accessed in the concurrent environment with an arbitrary set of threads T in {T_1, T_2, ...}, where each thread T_i (service client) requests service operation in a specific state S(T_i). An operation in a particular state does not necessarily block performing concurrent operations in other states on the same object , but the required state information has to be provided for each operation . The required state is often pre-defined (by context) and exactly the same for all operations performed by a given client. The state information should be transparent to the end user , who is not aware of it.

An algorithm to concurrently access multi-state objects graph is necessary. Such algorithm should be easy to use, transparent to users and it should provide high throughput of operations.

Setting state for threads is performed by using thread local storage (TLS) mechanism. The required state is stored for each client thread . The TLS mechanism is available in modern programming languages like Java.

Our solution

When an operation in a specific state is requested , the value of the state is retrieved from TLS and used by the objects that are referenced by the thread .

Why is it optimal?

- It is transparent to users, no changes in the public interface are required .

- Traversing the graph of objects is not necessary to change the state , therefore, the graph size does not impact the performance of state switching .

- The objects can be concurrently accessed without a need of synchronization to temporarily change the object state. If needed, additional internal synchronization can be applied, but it is hidden from the users.

- Users do not need to remember to restore the previous state of objects or release locks, when they finish using the service. User state is private and not visible to other users.

- The state information is set once and kept only in one place per client , which is


Page 02 of 4

consistent and easy to use.

How is it different?

In a classic object-oriented programming paradigm, users can interact with an object (service) only via public interface methods. The internal state of the service is hi...