Safe language static variables initialization in a multitasking system
First Claim
1. A method for sharing a class among a plurality of applications in a multitasking computer system, the method comprising:
- removing one or more static fields from the class;
creating a separate copy of the one or more static fields for each of the plurality of applications that utilizes the class, wherein each of the separate copies corresponds to one of the plurality of applications;
creating one or more access methods for the one or more static fields, wherein the access methods are operable to access the corresponding separate copy of the one or more static fields based upon the identity of the utilizing application; and
initializing each separate copy of the static fields once, wherein the initializing includes;
embedding in a class constructor one or more instructions for performing the initializing each separate copy of the static fields; and
executing the class constructor once for each separate copy of the static fields.
2 Assignments
0 Petitions
Accused Products
Abstract
A system and method are provided for thread-safe initialization of static variables in a multitasking system. In one embodiment, the static fields of a class may be “virtualized” such that each application that utilizes the class has its own copy of static fields. Each separate copy of the static fields is initialized only once. Instructions for performing the initialization may be embedded in a class constructor. The class constructor may be executed only once for each separate copy of the static fields. A template class may be loaded for each separate copy of the static fields when a copy of the static fields is sought to be initialized. The template class may include a static initializer for one of the separate copies of the static fields. The static initializer may be executed once for each separate copy of the static fields.
-
Citations
21 Claims
-
1. A method for sharing a class among a plurality of applications in a multitasking computer system, the method comprising:
-
removing one or more static fields from the class;
creating a separate copy of the one or more static fields for each of the plurality of applications that utilizes the class, wherein each of the separate copies corresponds to one of the plurality of applications;
creating one or more access methods for the one or more static fields, wherein the access methods are operable to access the corresponding separate copy of the one or more static fields based upon the identity of the utilizing application; and
initializing each separate copy of the static fields once, wherein the initializing includes;
embedding in a class constructor one or more instructions for performing the initializing each separate copy of the static fields; and
executing the class constructor once for each separate copy of the static fields. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A carrier medium comprising program instructions for sharing a class among a plurality of applications in a multitasking computer system, wherein the program instructions are computer-executable to implement:
-
removing one or more static fields from the class;
creating a separate copy of the one or more static fields for each of the plurality of applications that utilizes the class, wherein each of the separate copies corresponds to one of the plurality of applications;
creating one or more access methods for the one or more static fields, wherein the access methods are operable to access the corresponding separate copy of the one or more static fields based upon the identity of the utilizing application; and
initializing each separate copy of the static fields once, wherein the initializing includes;
embedding in a class constructor one or more instructions for performing the initializing each separate copy of the static fields; and
executing the class constructor once for each separate copy of the static fields. - View Dependent Claims (9, 10, 11, 12, 13, 14)
-
-
15. A multitasking computer system for isolating the execution of a plurality of applications, the system comprising:
-
an original class utilized by the plurality of applications, wherein the original class comprises one or more static fields;
a modified original class generated from the original class, wherein the modified class comprises the original class without the static fields;
a static field class generated from the original class, wherein each instance of the static field class corresponds to one of the plurality of applications, wherein the static field class comprises one or more instance fields corresponding to the one or more static fields of the original class, and wherein each instance of the static field class is initialized once; and
a class constructor which comprises one or more instructions for initializing each instance of the static field class, and wherein the class constructor is configured to be executed once for each instance of the static field class. - View Dependent Claims (16, 17, 18, 19, 20, 21)
-
Specification