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

77 lines
4.7 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="Job-scoped resources and thread safety" />
<meta name="abstract" content="Many system and application resources are available only within a defined job. When writing a multithreaded application or service, you must evaluate your use of job-scoped resources. The use of these resources must not conflict with or negatively affect other threads in the process." />
<meta name="description" content="Many system and application resources are available only within a defined job. When writing a multithreaded application or service, you must evaluate your use of job-scoped resources. The use of these resources must not conflict with or negatively affect other threads in the process." />
<meta name="DC.Relation" scheme="URI" content="rzahwsafco.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="rzahwjre-jreco" />
<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>Job-scoped resources and thread safety</title>
</head>
<body id="rzahwjre-jreco"><a name="rzahwjre-jreco"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Job-scoped resources and thread safety</h1>
<div><p>Many system and application resources are available only within
a defined job. When writing a multithreaded application or service, you must
evaluate your use of job-scoped resources. The use of these resources must
not conflict with or negatively affect other threads in the process.</p>
<div class="section"><p>Some resources (open database files, for example) are scoped to
the activation group. For the purposes of this discussion, resources that
are scoped to the activation group must be treated with the same considerations
as job-scoped resources. All of the threads that use the activation group
use them.</p>
</div>
<div class="section"><p>Your application can use appropriate synchronization techniques
if threads in your application modify these resources while other threads
are using them, and you need to ensure a consistent view of the resources
between your threads.</p>
</div>
<div class="section"><div class="p">Some of the common job-scoped or activation group-scoped resources
are as follows:<ul><li>Heap, static, and global storage:<p>The most commonly shared resource.
For more information, see the section about storage usage.</p>
</li>
<li>Open files:<p>After you open a file, threads in a process can directly
share integrated file system file and database files by passing the file handle
pointer or file descriptor number to another thread. The working directory
is always scoped to the process.</p>
</li>
<li>Locales:<p>The locale of an application is an activation group resource.
All threads share the locale. Changing the locale affects other threads with
regard to collating sequences or other locale information.</p>
</li>
<li>Coded character set identifier:<p>Changing the coded character set identifier
(CCSID) of a job affects the current data translation or representation of
all threads in that job.</p>
</li>
<li>Environment variables:<p>Your application commonly uses environment
variables for configuration and optional behavior. All the threads in the
job share them.</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>
</body>
</html>