Method and system for coordinating access to objects of different thread types in a shared memory space
First Claim
1. A method in a computer system for accessing objects of different thread types in a single process, the method comprising:
- during execution of a single-threaded apartment (STA) thread,requesting access to a free-threaded object; and
in response to the request to access a free threaded object,creating a multi-threaded apartment (MTA) thread;
requesting the MTA thread to instantiate the free threaded object;
receiving a marshalled pointer to the free-threaded object;
unmarshalling the received pointer; and
accessing the instantiated free-threaded object using the unmarshalled pointer wherein an MTA thread accesses the free-threaded object on behalf of the STA thread; and
during execution of an MTA thread,requesting access to an apartment-threaded object; and
in response to the request to access an apartment-threaded object,creating an STA thread;
requesting the STA thread to instantiate the apartment-threaded object;
receiving a marshalled pointer to the apartmnent-threaded object;
unmarshalling the received pointer; and
accessing the instantiated apartment-threaded object using the unmarshalled pointer wherein the STA thread accesses the apartment-threaded object on behalf of the MTA thread.
2 Assignments
0 Petitions
Accused Products
Abstract
A computer-based method and system for accessing objects of different thread types in a single process. The system provides single-threaded apartments (STAs) for loading apartment-threaded objects and a multi-threaded apartment (MTA) for loading free-threaded objects. Each STA has a single thread, and the MTA has multiple threads. When an STA thread requests to access a free-threaded object, the system creates an MTA thread and requests the MTA thread to instantiate the free-threaded object. The STA thread then receives a marshalled pointer to the free-threaded object and unmarshals the received pointer. The STA thread then accesses the free-threaded object using the unmarshalled pointer so that the MTA thread accesses the free-threaded object on behalf of the STA thread. When an MTA thread requests access to an apartment-threaded object, the system creates an STA thread and requests the STA thread to instantiate the apartment-threaded object. The MTA thread then receives a marshalled pointer to the apartment threaded object and unmarshals the received pointer. The MTA thread then accesses the apartment-threaded object using the unmarshalled pointer so that the STA thread accesses the apartment-threaded object on behalf of the MTA thread.
-
Citations
28 Claims
-
1. A method in a computer system for accessing objects of different thread types in a single process, the method comprising:
-
during execution of a single-threaded apartment (STA) thread, requesting access to a free-threaded object; and in response to the request to access a free threaded object, creating a multi-threaded apartment (MTA) thread; requesting the MTA thread to instantiate the free threaded object; receiving a marshalled pointer to the free-threaded object; unmarshalling the received pointer; and accessing the instantiated free-threaded object using the unmarshalled pointer wherein an MTA thread accesses the free-threaded object on behalf of the STA thread; and during execution of an MTA thread, requesting access to an apartment-threaded object; and in response to the request to access an apartment-threaded object, creating an STA thread; requesting the STA thread to instantiate the apartment-threaded object; receiving a marshalled pointer to the apartmnent-threaded object; unmarshalling the received pointer; and accessing the instantiated apartment-threaded object using the unmarshalled pointer wherein the STA thread accesses the apartment-threaded object on behalf of the MTA thread.
-
-
2. A method in a computer system for accessing a free-threaded object from a single-threaded apartment thread (STA) thread, the method comprising:
during execution of the STA thread, requesting access to the free-threaded object; and in response to the request to access a free-threaded object, selecting a multi-threaded apartment (MTA) thread for accessing the object; requesting the selected MTA thread to access the free-threaded object on behalf of the STA thread; dispatching messages received while the MTA thread is accessing the free-threaded object; and receiving notification that the MTA thread has completed accessing the free-threaded object. - View Dependent Claims (3, 4, 5, 6, 7, 8)
-
9. A method in a computer system for accessing an apartment-threaded object from a multi-threaded apartment (MTA) thread, the method comprising:
during execution of the MTA thread, requesting access to the apartment-threaded object; and in response to the request to access the apartment-threaded object, selecting a single-threaded apartment (STA) thread to access the object; requesting the selected STA thread to access the apartment threaded object on behalf of the MTA thread; suspending execution while the STA thread is accessing the apartment-threaded object; and resuming execution when notified that the STA thread has completed accessing the apartment-threaded object. - View Dependent Claims (10, 11, 12, 13, 14)
-
15. A method in a computer system for providing access to apartment-threaded objects and free-threaded objects in memory shared by multiple threads, the method comprising:
-
creating a single-threaded apartment having a single-threaded apartment (STA) thread, each apartment object being loaded into the single-threaded apartment; creating a multi-threaded apartment having multiple multi-threaded apartment (MTA) threads, each free-threaded object being loaded into the multi-threaded apartment; when the STA thread requests to access a free-threaded object, accessing the free-threaded object from a selected MTA thread on behalf of the STA thread; and when a MTA thread requests to accesses an apartment-threaded object, accessing the apartment threaded object from the STA thread on behalf of the MTA thread. - View Dependent Claims (16, 17, 18, 19, 20, 21)
-
-
22. A computer-readable medium containing instructions for causing a computer system to provide access to apartment-threaded objects and free-threaded objects in memory shared by multiple threads, by:
-
creating a single-threaded apartment having a single-threaded apartment (STA) thread, each apartment object being loaded into the single threaded apartment; creating a multi-threaded apartment having multiple multi-threaded apartment (MTA) threads, each free-threaded object being loaded into the multi-threaded apartment; when the STA thread requests to access a free-threaded object, creating an MTA thread and accessing the free-threaded object from created MTA thread on behalf of the STA thread; and when a MTA thread requests to accesses an apartment-threaded object, accessing the apartment threaded object from the STA thread on behalf of the MTA thread. - View Dependent Claims (23, 24, 25, 26, 27, 28)
-
Specification