CPI-C Reference


Concurrent Operations

CPI Communications provides for concurrent call operations (multiple call operations in progress simultaneously) on a conversation by grouping calls in logical associations or conversation queues. Calls associated with one queue are processed independently of calls associated with other queues or with no queue. Table 6 shows the different conversation queues and calls associated with them.

The send-receive mode of the conversation determines what queues are available for the conversation. Table 6 shows the send-receive modes for which the conversation queues are available.

A program may initiate concurrent operations by using multiple program threads on systems with multi-threading support. See "Using Multiple Program Threads". Alternatively, a program may use queue-level non-blocking support to regain control when a call operation on a queue cannot complete immediately. The call operation remains in progress. The program may issue a call associated with another queue or perform other processing. Queue-level non-blocking is described in "Queue-Level Non-Blocking".

Only one call operation is allowed to be in progress on a given conversation queue at a time. If a program issues a call associated with a queue that has a previous call operation still in progress, the later call returns with the CM_OPERATION_NOT_ACCEPTED return code.

Using Multiple Program Threads

While CPI Communications itself does not provide multi-threading support, some implementations are designed to work with multi-threading support in the base operating system and to allow multi-threaded programs to use CPI Communications. On such a system, a program may create separate threads to initiate concurrent operations on a conversation. For example, a program may create separate threads to handle the send and receive operations on a full-duplex conversation, where the Send-Data and Receive calls are associated with the Send and Receive queues, respectively. Each thread's operation proceeds independently; in particular, the sending thread may continue to send data to the partner program while the receiving thread is waiting for a Receive call to complete.

It is the responsibility of the program to ensure that action taken by one thread does not interfere with action taken by another thread. For example, unexpected results may occur if two threads issue calls associated with the same queue, or if one thread modifies the value of a conversation characteristic that affects the processing of a call issued by another thread.

Table 6. Conversation Queues--Associated Calls and Send-Receive Modes
Conversation Queue CPI Communications Calls Send-Receive Mode
Initialization Accept_Incoming
Allocate
Extract_Mapped_Initialization_Data
Set_AE_Qualifier
Set_Allocate_Confirm
Set_AP_Title
Set_Application_Context_Name
Set_Conversation_Security_Password
Set_Conversation_Security_Type
Set_Conversation_Security_User_ID
Set_Conversation_Type
Set_Initialization_Data
Set_Mapped_Initialization_Data
Set_Mode_Name
Set_Partner_ID
Set_Partner_LU_Name
Set_Return_Control
Set_Send_Receive_Mode
Set_Sync_Level
Set_Transaction_Control
Set_TP_Name
Half-duplex and full-duplex
Send Confirmed
Deallocate
Deferred_Deallocate
Flush
Include_Partner_In_Transaction
Prepare
Send_Data
Send_Error
Send_Mapped_Data
Set_Deallocate_Type
Set_Log_Data
Set_Prepare_Data_Permitted
Set_Send_Type
Full-duplex
Receive Receive
Receive_Mapped_Data
Set_Fill
Set_Receive_Type
Full-duplex
Send-Receive Confirm
Confirmed
Deallocate
Deferred_Deallocate
Flush
Include_Partner_In_Transaction
Prepare
Prepare_To_Receive
Receive
Receive_Mapped_Data
Send_Data
Send_Mapped_Data
Send_Error
Set_Confirmation_Urgency
Set_Deallocate_Type
Set_Error_Direction
Set_Fill
Set_Log_Data
Set_Prepare_Data_Permitted
Set_Prepare_To_Receive_Type
Set_Receive_Type
Set_Send_Type
Half-duplex
Expedited-Send Request_To_Send (Half-duplex only)
Send_Expedited_Data
Half-duplex and full-duplex
Expedited-Receive Receive_Expedited_Data
Half-duplex and full-duplex
Determined by the queue named on the call Set_Queue_Callback_Function
Set_Queue_Processing_Mode
Half-duplex and full-duplex

Note: The following calls are not associated with any queue.


[ Top of Page | Previous Page | Next Page | Table of Contents ]