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

102 lines
5.9 KiB
HTML

<?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="CL commands and thread safety" />
<meta name="abstract" content="The Integrated Language Environment (ILE) CL run time and compiler-generated code are threadsafe. Original program model (OPM) CL programs are not threadsafe." />
<meta name="description" content="The Integrated Language Environment (ILE) CL run time and compiler-generated code are threadsafe. Original program model (OPM) CL programs are not threadsafe." />
<meta name="DC.Relation" scheme="URI" content="rzahwsafco.htm" />
<meta name="DC.Relation" scheme="URI" content="rzahwmulco.htm" />
<meta name="DC.Relation" scheme="URI" content="rzahwnonco.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="rzahwclc-clcco" />
<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>CL commands and thread safety</title>
</head>
<body id="rzahwclc-clcco"><a name="rzahwclc-clcco"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">CL commands and thread safety</h1>
<div><p>The Integrated
Language Environment<sup>®</sup> (ILE) CL run time and compiler-generated code are
threadsafe. Original program model (OPM) CL programs are not threadsafe.</p>
<div class="section"><p>For any ILE CL code that is compiled before Version 4 Release
3 or any OPM CL code, the CL run time sends a CPD000B diagnostic
message and continues to run with unpredictable results. This might or might
not be threadsafe, depending on the underlying code.</p>
</div>
<div class="section"><p>Command analyzer is threadsafe. For a given command, if the threadsafe
attribute (THDSAFE) is *NO and the multithreaded job action attribute (MLTTHDACN)
is set to *NORUN or *MSG, the command analyzer does one of the following when
such a command is called in a job capable of multithreaded operations: </p>
<ul><li>If MLTTHDACN is set to *NORUN in a multithreaded job, command analyzer
sends a CPD000D diagnostic message, and the command does not run. A CPF0001
escape message then follows the CPD000D diagnostic message.</li>
<li>If MLTTHDACN is set to *MSG in a multithreaded job, command analyzer sends
a CPD000D diagnostic message, and the program continues to run with unpredictable
results.</li>
<li>If the job is capable of running multiple threads but is not actually
multithreaded, command analyzer allows commands that are not threadsafe to
run without interference.</li>
</ul>
<p>If MLTTHDACN is set to *RUN, the command analyzer does not send a
diagnostic message and allows the command to run. The results of this are
unpredictable. Also, MLTTHDACN only applies to comments whose THDSAFE value
is *NO. To determine the THDSAFE and MLTTHDACN values for a command, use <span class="cmdname">Display
Command (DSPCMD)</span>.</p>
</div>
<div class="section"><p>The MLTTHDACN value of some commands is set to *SYSVAL. In this
case, command analyzer uses the QMLTTHDACN system value to decide how to
process the command. </p>
</div>
<div class="section"><p>To display the setting of this value on <span class="keyword">i5/OS™</span>: </p>
</div>
<div class="section"><p><span class="cmdname">DSPSYSVAL</span> SYSVAL(QMLTTHDACN) </p>
</div>
<div class="section"><p>To change the setting of this value on <span class="keyword">i5/OS</span>: </p>
</div>
<div class="section"><p><span class="cmdname">CHGSYSVAL</span> SYSVAL(QMLTTHDACN) VALUE(x) </p>
</div>
<div class="section"><div class="p">Sample output from <span class="cmdname">DSPSYSVAL</span>: <pre>
Display System Value
System value . . . . . : QMLTTHDACN
Description . . . . . : Multithreaded job action
Multithreaded job
action . . . . . . . : 2
1=Perform the function that is not
threadsafe without sending a message
2=Perform the function that is not
threadsafe and send an informational
message
3=Do not perform the function that is
not threadsafe </pre>
</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="relconcepts"><strong>Related concepts</strong><br />
<div><a href="rzahwmulco.htm" title="If you are going to write multithreaded applications or server applications for i5/OS, you should be familiar with several techniques.">Multithreaded programming techniques</a></div>
<div><a href="rzahwnonco.htm" title="Your multithreaded application at times requires access to functions or system services that are not thread safe. There are few completely safe alternatives for calling these functions.">Function calls that are not thread safe</a></div>
</div>
</div>
</body>
</html>