API thread safety classifications

Each API has a threadsafe classification. Before using an API, you need to determine if it is safe to call that API in your multithreaded program.

There are several types of threadsafe classifications.
  • Threadsafe: yes

    This classification indicates that you can safely call the API simultaneously in multiple threads without restrictions. This classification also indicates that all functions called by this API are threadsafe.

  • Threadsafe: conditional

    This classification indicates that not all functions provided by the API are threadsafe. The Usage Notes section of the API provides information that relates to thread safety limitations. Many APIs are classified as conditionally threadsafe because either some underlying system support is not threadsafe or the API can call an exit point. For example, many of the file system APIs are completely threadsafe when used with files in a threadsafe file system. Some conditionally threadsafe APIs might deny access under some circumstances. The API usage notes describe the conditions that cause the function to deny access.

  • Threadsafe: no

    This classification indicates that the API is not threadsafe and that the API must not be used in a multithreaded program. Although some APIs that are not threadsafe might deny access, most APIs that are not threadsafe do not. Unlike in CL commands, no diagnostic message is in the job log to indicate that an API that is not threadsafe has been called (other than APIs that deny access). There are techniques for calling functions that are not threadsafe in multithreaded programs.