Some COBOL applications depend on subsystems or other applications. In a multithreaded environment, these dependencies and others result in some limitations on COBOL programs.
In general, you must synchronize access to resources that are visible to the application within a run unit. Exceptions to this requirement are DISPLAY and ACCEPT, which you can use from multiple threads; all synchronization is provided for these by the runtime environment.
DB2: You can run a DB2 application in multiple threads. However, you must provide any needed synchronization for accessing DB2 data.
SORT, MERGE; and DB2, SdU, and SFS file I/O: SORT and MERGE should be active in only one thread at a time. Similarly, input and output for DB2, SdU, and SFS files should be active from only one thread at a time. However, the COBOL runtime environment does not enforce either of these restrictions. The application must therefore do so.
related tasks
Making recursive calls
related references
DB2 file system
SdU file system
SFS file system