The Methods & Tools Special Interest Group met today from 4 pm till 5:40 pm Central European Time.
- COBIA threading models
U.S. Environmental Protection Agency (represented by Bill BARRETT), AmsterCHEM (represented by Jasper van BATEN), Bryan Research & Engineering (represented by Michael HLAVINKA), Michel PONS (contractor to CO-LaN as Chief Technology Officer).
At the CAPE-OPEN 2021 Annual Meeting, Jasper van BATEN presented on COBIA Marshalling as well as discussed the COBIA Threading models. As explained then, design decisions still need to be made on the COBIA Threading models. Work package 1 of COBIA Phase III cannot be completed till the design of COBIA Threading models is not finalized. Mostly COBIA Threading models are obviously going to interact with COM Threading models since COM-based and COBIA-based CAPE-OPEN applications interoperate through COMBIA.
Methods & Tools SIG developed a likely scenario:
- A COBIA-based PME requests the use of a COM-based CAPE-OPEN Unit Operation.
- The COBIA-based PME passes the request to create the COM-based CAPE-OPEN Unit Operation to COMBIA.
- COMBIA detects that the COM-based Unit Operation advertises itself as working under “both” Apartment Models, meaning the COM-based Unit Operation adopts the Apartment Model of the creating thread.
- COM is initialized as Single Thread Apartment (STA) in the current thread where the COBIA-based PME is executed.
- COMBIA initializes a thread in a Multi-Threaded Apartment (MTA) dedicated for PMC creation only.
- COMBIA creates the COM-based CAPE-OPEN Unit Operation from the MTA thread.
- COMBIA COM Material Object is connected to one of the Ports of the COM-based Unit Operation from the original STA thread using ICapeUnitPort.Connect(object). We want this call to be unmarshaled.
- The PME calls “Calculate” on the Unit Operation from a different STA. We want this call to be unmarshaled (there is no marshaling if the call is executed on the STA the call is made from).
- Callbacks from the Unit Operation to the Material Object during the execution of the “Calculate” method in Step 8 should be unmarshaled.
The above scenario needs to be further refined. The strategy above in terms of COM+ initialization and use of a Multi-Thread Apartment for PMC creation needs to be validated.
Contact Bill BARRETT (representative of US Environmental Protection Agency, leader of the Methods & Tools Special Interest Group) should you wish to join the Methods & Tools Special Interest Group. Its charter is: “Improve integration, and expand utilization of Computer-Aided Process Engineering (CAPE) applications within the enterprise through identification and resolution of existing cross-cutting issues with the CAPE-OPEN platform, develop mechanisms for use of CAPE within other application domains, and incorporate advances in information technology into the CAPE-OPEN platform.”