133 lines
8.5 KiB
HTML
133 lines
8.5 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="task" />
|
|
<meta name="DC.Title" content="Allocate resources" />
|
|
<meta name="abstract" content="Objects are allocated on the system to guarantee integrity and to promote the highest possible degree of concurrency." />
|
|
<meta name="description" content="Objects are allocated on the system to guarantee integrity and to promote the highest possible degree of concurrency." />
|
|
<meta name="DC.subject" content="allocating, resource, object, library, allocating resource, DLCOBJ (Deallocate Object) command, Deallocate Object (DLCOBJ) command, command, CL, DLCOBJ (Deallocate Object), Deallocate Object (DLCOBJ), deallocating, DLCOBJ (Deallocate Object) command, Deallocate Object (DLCOBJ) command, DLCOBJ (Deallocate Object), Deallocate Object (DLCOBJ)" />
|
|
<meta name="keywords" content="allocating, resource, object, library, allocating resource, DLCOBJ (Deallocate Object) command, Deallocate Object (DLCOBJ) command, command, CL, DLCOBJ (Deallocate Object), Deallocate Object (DLCOBJ), deallocating, DLCOBJ (Deallocate Object) command, Deallocate Object (DLCOBJ) command, DLCOBJ (Deallocate Object), Deallocate Object (DLCOBJ)" />
|
|
<meta name="DC.Relation" scheme="URI" content="objec.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="objlockstates.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="dlsob.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="msghd.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="wmsgs.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="../cl/alcobj.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="../cl/dlcobj.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="../dbp/rbafoconcrec.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="allor" />
|
|
<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>Allocate resources</title>
|
|
</head>
|
|
<body id="allor"><a name="allor"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Allocate resources</h1>
|
|
<div><p>Objects are allocated on the system to guarantee integrity and
|
|
to promote the highest possible degree of concurrency.</p>
|
|
<div class="section"> <p>An object is protected even though several operations may be
|
|
performed on it at the same time. For example, an object is allocated so
|
|
that two users can read the object at the same time or one user can only read
|
|
the object while another can read and update the same object.</p>
|
|
<p>i5/OS™ allocates
|
|
objects by the function being performed on the object. For example: </p>
|
|
<ul><li>If a user is displaying or dumping an object, another user can read the
|
|
object.</li>
|
|
<li>If a user is changing, deleting, renaming, or moving an object, no one
|
|
else can use the object.</li>
|
|
<li>If a user is saving an object, someone else can read the object, but not
|
|
update or delete it; if a user is restoring the object, no one else can read
|
|
or update the object.</li>
|
|
<li>If a user is opening a database file for input, another user can read
|
|
the file. If a user is opening a database file for output, another user can
|
|
update the file.</li>
|
|
<li>If a user is opening a device file, another user can only read the file.</li>
|
|
</ul>
|
|
<p>Generally, objects are allocated on demand; that is, when a job step
|
|
needs an object, it allocates the object, uses the object, and deallocates
|
|
the object so another job can use it. The first job that requests the object
|
|
is allocated the object. In your program, you can handle the exceptions that
|
|
occur if an object cannot be allocated by your request.</p>
|
|
<p>Sometimes you
|
|
want to allocate an object for a job before the job needs the object, to ensure
|
|
its availability so a function that has only partially completed would not
|
|
have to wait for an object. This is called preallocating an object. You can
|
|
preallocate objects using the <span class="cmdname">Allocate Object (ALCOBJ)</span> command.
|
|
To allocate an object, you must have object existence authority, object management
|
|
authority, or operational authority for the object.</p>
|
|
<p>Allocated objects
|
|
are automatically deallocated at the end of a routing step. To deallocate
|
|
an object at any other time, use the <span class="cmdname">Deallocate Object (DLCOBJ)</span> command.</p>
|
|
<p>You
|
|
can allocate a program before it is called to protect it from being deleted.
|
|
To prevent a program from running in different jobs at the same time, an
|
|
exclusive lock must be placed on the program in each job before the program
|
|
is called in any job.</p>
|
|
<p>You cannot use the ALCOBJ or DLCOBJ commands to
|
|
allocate an APPC device description.</p>
|
|
<p>The following example is a batch
|
|
job that needs two files members for updating. Members from either file can
|
|
be read by another program while being updated, but no other programs can
|
|
update these members while this job is running. The first member of each
|
|
file is preallocated with an exclusive-allow-read lock state. </p>
|
|
<pre>//JOB JOBD(ORDER)
|
|
ALCOBJ OBJ((FILEA *FILE *EXCLRD) (FILEB *FILE *EXCLRD))
|
|
CALL PROGX
|
|
//ENDJOB</pre>
|
|
<p>Objects that are allocated to you should be deallocated as
|
|
soon as you are finished using them because other users may need those objects.
|
|
However, allocated objects are automatically deallocated at the end of the
|
|
routing step.</p>
|
|
<p>If the first members of FILEA and FILEB had not been preallocated,
|
|
the exclusive-allow-read restriction would not have been in effect. When you
|
|
are using files, you may want to preallocate them so that you are assured
|
|
they are not changing while you are using them. </p>
|
|
<div class="note"><span class="notetitle">Note:</span> If a single object
|
|
has been allocated more than once (by more than one allocate command), a single
|
|
DLCOBJ command will not completely deallocate that object. One deallocate
|
|
command is required for each allocate command.</div>
|
|
<p>The WAITRCD parameter
|
|
on a Create File command specifies how long to wait for a record lock. The
|
|
DFTWAIT parameter on the <span class="cmdname">Create Class (CRTCLS)</span> command
|
|
specifies how long to wait for other objects.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<ul class="ullinks">
|
|
<li class="ulchildlink"><strong><a href="objlockstates.htm">Lock states for objects</a></strong><br />
|
|
A lock state identifies the use of the object and whether it is shared.</li>
|
|
<li class="ulchildlink"><strong><a href="dlsob.htm">Display the lock states for objects</a></strong><br />
|
|
You can use the <span class="cmdname">Work with Object Locks (WRKOBJLCK)</span> command
|
|
or the <span class="cmdname">Work with Job (WRKJOB)</span> command to display the lock
|
|
states for objects.</li>
|
|
</ul>
|
|
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="objec.htm" title="This provides tasks and concepts specific to objects and libraries, including functions performed on objects, creating libraries, and specifying object authority.">Objects and libraries</a></div>
|
|
</div>
|
|
<div class="reltasks"><strong>Related tasks</strong><br />
|
|
<div><a href="msghd.htm" title="Predefined messages are stored in a message file.">Define message descriptions</a></div>
|
|
<div><a href="wmsgs.htm" title="This discusses some of the ways that messages can be used to communicate between users and programs.">Messages</a></div>
|
|
</div>
|
|
<div class="relinfo"><strong>Related information</strong><br />
|
|
<div><a href="../cl/alcobj.htm">Allocate Object (ALCOBJ) command</a></div>
|
|
<div><a href="../cl/dlcobj.htm">Deallocate Object (DLCOBJ) command</a></div>
|
|
<div><a href="../dbp/rbafoconcrec.htm">Lock records topic in Database Programming</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |