ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzahw_5.4.0.1/rzahwapico.htm

70 lines
4.2 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="reference" />
<meta name="DC.Title" content="API thread safety classifications" />
<meta name="abstract" content="Before using an API, you should determine if it is safe to call that API in your multithreaded program." />
<meta name="description" content="Before using an API, you should determine if it is safe to call that API in your multithreaded program." />
<meta name="DC.Relation" scheme="URI" content="rzahwsafco.htm" />
<meta name="DC.Relation" scheme="URI" content="../apiref/api.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rzahwapi-apico" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>API thread safety classifications</title>
</head>
<body id="rzahwapi-apico"><a name="rzahwapi-apico"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">API thread safety classifications</h1>
<div><p><span>Before using an API, you should determine if
it is safe to call that API in your multithreaded program.</span></p>
<div class="section"><div class="p">Each API has a threadsafe classification. The
three types of threadsafe classifications are as follows:<ul><li>Threadsafe: yes<p>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. </p>
</li>
<li>Threadsafe: conditional<p>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
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. </p>
</li>
<li>Threadsafe: no<p>This classification indicates that the API is not threadsafe
and that the API should not be used in a multithreaded program. While 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. </p>
</li>
</ul>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzahwsafco.htm" title="A function is threadsafe if you can start it simultaneously in multiple threads within the same process. A function is threadsafe if and only if all the functions it calls are also threadsafe.">Thread safety</a></div>
</div>
<div class="relinfo"><strong>Related information</strong><br />
<div><a href="../apiref/api.htm">Application Programming Interfaces</a></div>
</div>
</div>
</body>
</html>