91 lines
5.9 KiB
HTML
91 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="Data management considerations for multithreaded programming" />
|
|
<meta name="abstract" content="You should consider several topics when managing data in a multithreaded program." />
|
|
<meta name="description" content="You should consider several topics when managing data in a multithreaded program." />
|
|
<meta name="DC.Relation" scheme="URI" content="rzahwas4co.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rzahwprcco.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="rzahwdmc-dmcco" />
|
|
<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>Data management considerations for multithreaded programming</title>
|
|
</head>
|
|
<body id="rzahwdmc-dmcco"><a name="rzahwdmc-dmcco"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Data management considerations for multithreaded programming</h1>
|
|
<div><p>You should consider several topics when managing data in a multithreaded
|
|
program.</p>
|
|
<div class="section"><ul><li>File open operations:<p>Only integrated file system stream files, printer
|
|
files, distributed data management (DDM) files of type *IP, and local database
|
|
files can be opened in a multithread-capable job. Attempts to open *FILE objects
|
|
other than print files, type *IP DDM files, or local database files cause
|
|
a CPF4380 escape message to be sent to the function that opens
|
|
the file. The CPF4380 escape message signals that open attributes are not
|
|
valid in a multithreaded process. Local database files include physical and
|
|
logical files. Loosely coupled parallel (LCP) files are not local and send
|
|
the CPF4380 escape message when a function tries to open the file. Local database
|
|
files also do not include save files (*SAVF), which are device files, or other
|
|
communications files. You cannot open a printer file by specifying SPOOL(*NO).
|
|
If you specify SPOOL(*NO) when trying to open the print file, the CPF4380
|
|
escape message is sent to the function that tried to open the print file.</p>
|
|
<p>Multithread-capable
|
|
jobs allow shared opens. However, an open data path (ODP) cannot be shared
|
|
between threads. If a file is opened SHARE(*YES) and OPNSCOPE(*ACTGRPDFN)
|
|
is specified, any subsequent shared open within the same thread that is running
|
|
in the same activation group can share the ODP. If a file is opened SHARE(*YES)
|
|
with OPNSCOPE(*JOB) specified, any subsequent shared open of the file within
|
|
the same thread can share the ODP.</p>
|
|
</li>
|
|
<li>File overrides:<p> Multithreaded applications can only issue overrides
|
|
in their initial thread. Any attempt to issue an override in a secondary
|
|
thread returns the CPF180C escape message. Only overrides with job-level and
|
|
activation group-level scope affect secondary threads; overrides of call-level
|
|
scope are not visible. Overrides of all scope levels can affect initial threads.
|
|
You can use three different types of file override commands: <span class="cmdname">Override
|
|
with Database File (OVRDBF)</span>, <span class="cmdname">Override with Printer File
|
|
(OVRPRTF)</span>, and <span class="cmdname">Override with Message File (OVRMSGF)</span>.</p>
|
|
<p>You
|
|
can delete overrides in the initial thread, but not in secondary threads,
|
|
by calling the Delete Override (DLTOVR) command. DLTOVR returns the CPF180C
|
|
escape message if thrown against a secondary thread.</p>
|
|
</li>
|
|
<li>Reclaim resources commands:<p>None of the commands that
|
|
reclaim resources are threadsafe because the <span class="keyword">i5/OS™</span> operating
|
|
system does not track resources. The operating system cannot identify which
|
|
resources are in use by which threads. You cannot call the <span class="cmdname">Reclaim
|
|
Resources (RCLRSC)</span> and <span class="cmdname">Reclaim Activation Group (RCLACTGRP)</span> commands
|
|
in secondary threads. <span class="cmdname">RCLRSC</span> and <span class="cmdname">RCLACTGRP</span> can
|
|
be called in the initial thread of a multithread-capable job (<span class="parmname">ALWMLTTHD(*YES)</span>)
|
|
if secondary user threads are not present. If secondary user threads are present
|
|
in the job, these commands send a CPF180B escape message to the caller of
|
|
the command.</p>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzahwas4co.htm" title="All programs have at least one thread, referred to as the initial thread. In a program with multiple threads, each thread runs its code independently of the other threads in the program.">Threads on i5/OS</a></div>
|
|
</div>
|
|
<div class="relref"><strong>Related reference</strong><br />
|
|
<div><a href="rzahwprcco.htm" title="Only printer files opened with SPOOL(*YES) are allowed in a job that is capable of multithread operations.">Printer file considerations for multithreaded programming</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |