Tivoli Header

Tivoli Storage Manager Using the Application Program Interface


Using Multi-Threading

Note:
When you run applications that assume a multi-threaded API, use the dsmQueryAPIVersionEx call and verify that the level of the API is 3.1.6 or a higher level.

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.

Note:
The default for the API is single-thread mode. If an application does not call dsmSetUp with the mtflag value set to DSM_MULTITHREAD, the API permits only one session for each process.

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.

Note:
On Netware, we recommend setting the thread stack to 32K or greater. The dynamic reallocation of thread stack is not reliable. The Netware server stops a program because of errors.

To use a LAN-free session, use dsmSetUp mtFlag DSM_MULTITHREAD in your application.


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