共用方式為


2.2.2.3.1 ThreadingModelEnumerationProperty

The ThreadingModelEnumerationProperty type represents how the hosting model is to be selected for component instances.

Simple type: eDT_ULONG

Validity: MUST be one of the following values.

Value

Meaning

eTM_APARTMENT

0x00000000

Each component instance is to be STA-hosted. The STA thread used to host the component instance is to be selected as follows:

If an instantiation request originates from an STA thread in the same process in which the component is to be instantiated, the component instance is to be hosted on that thread.

Otherwise, the ORB is to select an existing STA thread or create a new STA thread to host the component instance according to some ORB-specific criteria.<14>

eTM_FREE

0x00000001

Each component instance is to be MTA-hosted. If no MTA threads exist in the process in which the component is to be instantiated at the time of the instantiation request, the ORB is to create at least one MTA thread.

eTM_MAIN

0x00000002

Each component instance is to be STA-hosted in the Main STA thread. If no STA threads exist in the process in which the component is to be instantiated at the time of the instantiation request, the ORB is to create one STA thread and designate it the Main STA thread.

eTM_BOTH

0x00000003

Each component instance is to be either STA-hosted or MTA-hosted, according to the following criteria:

If an instantiation request originates from an STA thread in the same process in which the component is to be instantiated, the component instance is to be STA-hosted on that thread.

If an instantiation request originates from an MTA thread in the same process in which the component is to be instantiated, the component instance is to be MTA-hosted.

If an instantiation request does not originate from within the process in which the component is to be instantiated, the component instance is to be MTA-hosted. If no MTA threads exist in the process at the time of the instantiation request, the ORB is to create at least one MTA thread.

eTM_NEUTRAL

0x00000004

Component instances are to be neutrally hosted.

Server validation: No validation requirements (COMA does not provide a mechanism for writing properties of this type).

Client validation: No validation requirements (COMA does not provide a mechanism for writing properties of this type).