You can optimize performance of multi-use objects by using multiple execution threads. With multiple threads, each new multi-use object runs independently - one client can't tie up the remote application for other clients. Figures T.4 and 21.5 illustrate how multiple threads avoid conflicts between clients.
Multi-use objects running in a single thread force clients to wait as objects compete for the execution thread.
Run multi-use objects in separate threads to prevent one client from tying up the remote application for other clients.
To make an application multithreaded, follow these steps:
The Unattended Execution check box is grayed if your project contains forms. Only applications without forms can be multithreaded.
There is one big restriction on creating multithreaded, multi-use objects - the application can't include forms. If your project includes one or more form modules, the Unattended Execution check box will be grayed, and you can't select it. If you add a form to a project with the check box selected, it will be deselected automatically.
You can work around this problem by using the multithreaded application to dole out running instances of single-use application objects. This type of multi-use application is called a pool manager and it is discussed in the later section "Optimizing Single-use Object Applications."