User's Guide > Asynchronous Mode > Asynchronous Mode
Asynchronous Mode
 
This section explains how to use Creo Object TOOLKIT C++ in Asynchronous Mode.
Overview
Asynchronous mode is a multiprocess mode in which the Creo Object TOOLKIT C++ application and Creo Parametric can perform concurrent operations. Unlike synchronous mode, the asynchronous mode uses remote procedure calls (rpc) as the means of communication between the application and Creo Parametric.
Another important difference between synchronous and asynchronous modes is in the startup of the Creo Object TOOLKIT C++ application. In synchronous mode, the application is started by Creo Parametric, based on information contained in the registry file. In asynchronous mode, the application is started independently of Creo Parametric and subsequently either starts or connects to a Creo Parametric process. The application can contain its own main() or wmain() function. Use wmain() if the application needs to receive command-line arguments as wchar_t, for example if the input contains non-usascii characters.
* 
An asynchronous application that starts Creo Parametric will not appear in the Auxiliary Applications dialog box.
The section How Creo Object TOOLKIT C++ Works in Overview of Creo Object TOOLKIT C++ section describes two modes—DLL and multiprocess (or “spawned”). These modes are synchronous modes in the sense that the Creo Object TOOLKIT C++ application and Creo Parametric do not perform operations concurrently. In spawn mode, each process can send a message to the other to ask for some operation, but each waits for a returning message that reports that the operation is complete. Control alternates between the two processes, one of which is always in a wait state.
Asynchronous mode applications operate with the same method of communication as spawn mode (multiprocess). The use of rpc in spawn mode causes this mode to perform significantly slower than DLL communications. For this reason, you should be careful not to apply asynchronous mode when it is not needed. Note that asynchronous mode is not the only mode in which your application can have explicit control over Creo Parametric.
An asynchronous application can also use the user_initialize() function, which will be called back by Creo Parametric when the application starts the connection. Note that in the asynchronous mode the callback to user_initialize() happens twice.
Was this helpful?