![]() |
![]() |
The multi-threaded API permits applications to create multiple sessions with the TSM server within the same process. The API can be entered again. Any calls can run in parallel from within different threads. To run the API in multi-threaded mode, set the mtflag value to DSM_MULTITHREAD on the dsmSetUp call. The dsmSetUp call must be the first call after the dsmQueryAPIVersionEx call. This call must return before any thread calls the dsmInitEx call. When all threads complete processing, enter a call to dsmCleanUp. The primary process should not end before all the threads complete processing. See callmt1.c in the sample.
For UNIX Only: For versions 3.1.6 through version 4.1.2, you cannot use the Trusted Communication Agent in multi-thread mode. If you want to use passwordaccess generate, you must be a TSM-Authorized user. For version 4.2 and beyond, this is no longer true.
Once dsmSetUp successfully completes, the application can begin multiple threads and enter multiple dsmInitEx calls. Each dsmInitEx call returns a handle for that session. Any subsequent calls on that thread for that session must use that handle value. Certain values are process-wide, environmental variables (values that are set on dsmSetUp). Each dsmInitEx call will parse options again. Each thread can run with different options by specifying an overwrite file or an options string on the dsmInitEx call. This enables different threads to go to different servers, or use different node names.
To use a LAN-free session, use dsmSetUp mtFlag DSM_MULTITHREAD in your application.