95 lines
6.1 KiB
HTML
95 lines
6.1 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="Determining whether to use data queues or user queues" />
|
|
<meta name="abstract" content="If user queues and data queues supply the same function, which one should you choose for your implementation? The following is a comparison of the two and an insight into when you should use one queue rather than the other." />
|
|
<meta name="description" content="If user queues and data queues supply the same function, which one should you choose for your implementation? The following is a comparison of the two and an insight into when you should use one queue rather than the other." />
|
|
<meta name="DC.Relation" scheme="URI" content="ExTaskDataque.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="conDomain.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="aboutapis.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="exdqdetermine" />
|
|
<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>Determining whether to use data queues or user queues</title>
|
|
</head>
|
|
<body id="exdqdetermine"><a name="exdqdetermine"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Determining whether to use data queues or user queues</h1>
|
|
<div><p>If user queues and data queues supply the same function, which
|
|
one should you choose for your implementation? The following is a comparison
|
|
of the two and an insight into when you should use one queue rather than the
|
|
other.</p>
|
|
<div class="section"><p>First, your programming experience is an important
|
|
consideration in selecting a queue type. If you are familiar with C or MI
|
|
programming, you may want to select the user queue. User queues can be accessed
|
|
only using MI, and MI can be used only by ILE RPG, ILE COBOL, C, and MI programs.</p>
|
|
<p>Next,
|
|
performance plays an important part in determining what type of queue to use.
|
|
As stated in System APIs or CL commands--when to use each, APIs generally
|
|
give better performance than CL commands. Also, MI instructions perform better
|
|
than an external call to an API because APIs have overhead associated with
|
|
them. User queues use MI instructions to manipulate entries; data queues use
|
|
APIs. Therefore, the user queue has better performance than the data queue.</p>
|
|
<p>Last,
|
|
you need to consider how the queue entries are manipulated. For example, you
|
|
need a way to perform enqueue and dequeue operations on entries from a queue.
|
|
As stated earlier, user queues use MI instructions to manipulate entries.
|
|
Specifically, you use the ENQ MI instruction to enqueue a message, and the
|
|
DEQ MI instruction to dequeue a message. If you are running at security level
|
|
40 or greater, you must ensure that the user queue is created in the user
|
|
domain in order to directly manipulate a user queue using MI instructions.
|
|
Because data queue entries are manipulated by APIs, the security level of
|
|
the machine does not limit the use of the API.</p>
|
|
<p>You cannot create a user
|
|
queue object in a library that does not permit user-domain objects, which
|
|
is determined by the QALWUSRDMN system value. (See Domain concepts for more
|
|
information on QALWUSRDMN.) Data queues are always created in the system domain,
|
|
so there is no problem with the data queue being created into a specific library.</p>
|
|
<p>The
|
|
following is a summary to help you select the type of queue that is right
|
|
for your program:</p>
|
|
<ul><li>Use user queues when: <ul><li>You have a programming background in MI.</li>
|
|
<li>You need the additional performance of an API for creating and deleting
|
|
and MI instructions for manipulating entries.</li>
|
|
<li>You do not need to create a user-domain queue into a library where the
|
|
QALWUSRDMN system value does not permit user-domain user objects when at security
|
|
level 40 or 50.</li>
|
|
</ul>
|
|
</li>
|
|
<li>Use data queues when: <ul><li>You have a programming background in or prefer to program in a high-level
|
|
language such as COBOL, C, or RPG.</li>
|
|
<li>You do not need the additional performance of MI instructions for directly
|
|
manipulating entries.</li>
|
|
<li>You need to create queues into a library that is not listed in the QALWUSRDMN
|
|
system value.</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="ExTaskDataque.htm" title="Data queues and user queues both provide a means for one or more processes to communicate asynchronously. The queues can be processed FIFO (first-in first-out), LIFO (last-in first-out), or by key.">Examples: Using data queues or user queues</a></div>
|
|
</div>
|
|
<div class="relconcepts"><strong>Related concepts</strong><br />
|
|
<div><a href="conDomain.htm" title="All objects are assigned a domain attribute when they are created.">Domain concepts</a></div>
|
|
<div><a href="aboutapis.htm" title="Describes most of the iSeries application programming interfaces (APIs), as well as some APIs for related products that can be used on iSeries servers.">About application programming interfaces (APIs)</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |