The Methods & Tools Special Interest Group met today from 4 pm till 5:40 pm Central European Time.

Agenda

  • COBIA threading models

Participants
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).

Highlights

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:

  1. A COBIA-based PME requests the use of a COM-based CAPE-OPEN Unit Operation.
  2. The COBIA-based PME passes the request to create the COM-based CAPE-OPEN Unit Operation to COMBIA.
  3. 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.
  4. COM is initialized as Single Thread Apartment (STA) in the current thread where the COBIA-based PME is executed.
  5. COMBIA initializes a thread in a Multi-Threaded Apartment (MTA) dedicated for PMC creation only.
  6. COMBIA creates the COM-based CAPE-OPEN Unit Operation from the MTA thread.
  7. 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.
  8. 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).
  9. 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

Picture of Bill BARRETT (US EPA representative) in December 2018Contact 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.”