ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzab6_5.4.0.1/cthread.htm

54 lines
3.4 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="concept" />
<meta name="DC.Title" content="Thread safety" />
<meta name="abstract" content="A function is considered threadsafe if you can start it simultaneously in multiple threads within the same process." />
<meta name="description" content="A function is considered threadsafe if you can start it simultaneously in multiple threads within the same process." />
<meta name="DC.Relation" scheme="URI" content="aconcepts.htm" />
<meta name="DC.Relation" scheme="URI" content="xthread.htm" />
<meta name="DC.Relation" scheme="URI" content="xdns.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2001, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2001, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="cthread" />
<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>Thread safety</title>
</head>
<body id="cthread"><a name="cthread"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Thread safety</h1>
<div><p>A function is considered threadsafe if you can start it simultaneously
in multiple threads within the same process.</p>
<p>A function is threadsafe if and only if all the functions it calls are
threadsafe also. Socket APIs are comprised of system and network functions,
which are both threadsafe.</p>
<p>All network functions with names that end in "_r" have similar semantics
and are also threadsafe. </p>
<p>The other resolver routines are threadsafe with each other but they use
the _res data structure. This data structure is shared between all threads
in a process and can be changed by an application during a resolver call. </p>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="aconcepts.htm" title="Advanced socket concepts go beyond a general discussion of what sockets are and how they work. They provide ways to design socket applications for larger and more complex networks.">Advanced socket concepts</a></div>
</div>
<div class="relref"><strong>Related reference</strong><br />
<div><a href="xthread.htm" title="Here is an example of a program that uses gethostbyaddr_r().">Example: Use gethostbyaddr_r() for threadsafe network routines</a></div>
<div><a href="xdns.htm" title="This example shows how to query and update Domain Name System (DNS) records.">Example: Update and query DNS</a></div>
</div>
</div>
</body>
</html>