Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 723830890bac44da3d113209b14e090b > files > 672

sbcl-1.0.31-1mdv2010.0.i586.rpm

<html lang="en">
<head>
<title>sb-queue - SBCL 1.0.31 User Manual</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="SBCL 1.0.31 User Manual">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Contributed-Modules.html#Contributed-Modules" title="Contributed Modules">
<link rel="prev" href="sb_002dmd5.html#sb_002dmd5" title="sb-md5">
<link rel="next" href="sb_002drotate_002dbyte.html#sb_002drotate_002dbyte" title="sb-rotate-byte">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--

     This manual is part of the SBCL software system. See the `README'
     file for more information.

     This manual is largely derived from the manual for the CMUCL
     system, which was produced at Carnegie Mellon University and later
     released into the public domain. This manual is in the public
     domain and is provided with absolutely no warranty. See the
     `COPYING' and `CREDITS' files for more information.
   -->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<div class="node">
<a name="sb-queue"></a>
<a name="sb_002dqueue"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="sb_002drotate_002dbyte.html#sb_002drotate_002dbyte">sb-rotate-byte</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="sb_002dmd5.html#sb_002dmd5">sb-md5</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Contributed-Modules.html#Contributed-Modules">Contributed Modules</a>
<hr>
</div>

<h3 class="section">16.5 sb-queue</h3>

<p><a name="index-Queue_002c-FIFO-656"></a>
The <code>sb-queue</code> module, loadable by
<pre class="lisp">     (require :sb-queue)
</pre>
   <p>provides a thread-safe lockless FIFO queues.

   <p><a name="Structure-sb_002dqueue_003aqueue"></a>

<div class="defun">
&mdash; Structure: <b>sb-queue:queue</b><var><a name="index-sb_002dqueue_003aqueue-657"></a></var><br>
<blockquote><p><a name="index-sb_002dqueue_003aqueue-658"></a>Class precedence list: <code>queue, structure-object, t</code>

        <p>Lock-free thread safe queue. <code>enqueue</code> can be used to add objects to the queue,
and <code>dequeue</code> retrieves items from the queue in <code>fifo</code> order. 
</p></blockquote></div>

   <p><a name="Function-sb_002dqueue_003adequeue"></a>

<div class="defun">
&mdash; Function: <b>sb-queue:dequeue</b><var> queue<a name="index-sb_002dqueue_003adequeue-659"></a></var><br>
<blockquote><p><a name="index-sb_002dqueue_003adequeue-660"></a>Retrieves the oldest value in <code>queue</code> and returns it as the primary value,
and <code>t</code> as secondary value. If the queue is empty, returns <code>nil</code> as both primary
and secondary value. 
</p></blockquote></div>

   <p><a name="Function-sb_002dqueue_003aenqueue"></a>

<div class="defun">
&mdash; Function: <b>sb-queue:enqueue</b><var> value queue<a name="index-sb_002dqueue_003aenqueue-661"></a></var><br>
<blockquote><p><a name="index-sb_002dqueue_003aenqueue-662"></a>Adds <code>value</code> to the end of <code>queue</code>. Returns <code>value</code>. 
</p></blockquote></div>

   <p><a name="Function-sb_002dqueue_003alist_002dqueue_002dcontents"></a>

<div class="defun">
&mdash; Function: <b>sb-queue:list-queue-contents</b><var> queue<a name="index-sb_002dqueue_003alist_002dqueue_002dcontents-663"></a></var><br>
<blockquote><p><a name="index-sb_002dqueue_003alist_002dqueue_002dcontents-664"></a>Returns the contents of <code>queue</code> as a list without removing them from the
<code>queue</code>. Mainly useful for manual examination of queue state. 
</p></blockquote></div>

   <p><a name="Function-sb_002dqueue_003amake_002dqueue"></a>

<div class="defun">
&mdash; Function: <b>sb-queue:make-queue</b><var> &amp;key name initial-contents<a name="index-sb_002dqueue_003amake_002dqueue-665"></a></var><br>
<blockquote><p><a name="index-sb_002dqueue_003amake_002dqueue-666"></a>Returns a new <code>queue</code> with <code>name</code> and contents of the <code>initial-contents</code>
sequence enqueued. 
</p></blockquote></div>

   <p><a name="Function-sb_002dqueue_003aqueue_002dcount"></a>

<div class="defun">
&mdash; Function: <b>sb-queue:queue-count</b><var> queue<a name="index-sb_002dqueue_003aqueue_002dcount-667"></a></var><br>
<blockquote><p><a name="index-sb_002dqueue_003aqueue_002dcount-668"></a>Returns the number of objects in <code>queue</code>. Mainly useful for manual
examination of queue state, and in <code>print-object</code> methods: inefficient as it
walks the entire queue. 
</p></blockquote></div>

   <p><a name="Function-sb_002dqueue_003aqueue_002dempty_002dp"></a>

<div class="defun">
&mdash; Function: <b>sb-queue:queue-empty-p</b><var> queue<a name="index-sb_002dqueue_003aqueue_002dempty_002dp-669"></a></var><br>
<blockquote><p><a name="index-sb_002dqueue_003aqueue_002dempty_002dp-670"></a>Returns <code>t</code> if <code>queue</code> is empty, <code>nil</code> otherwise. 
</p></blockquote></div>

   <p><a name="Function-sb_002dqueue_003aqueue_002dname"></a>

<div class="defun">
&mdash; Function: <b>sb-queue:queue-name</b><var> instance<a name="index-sb_002dqueue_003aqueue_002dname-671"></a></var><br>
<blockquote><p><a name="index-sb_002dqueue_003aqueue_002dname-672"></a>Name of a <code>queue</code>. Can be assingned to using <code>setf</code>. Queue names
can be arbitrary printable objects, and need not be unique. 
</p></blockquote></div>

   <p><a name="Function-sb_002dqueue_003aqueuep"></a>

<div class="defun">
&mdash; Function: <b>sb-queue:queuep</b><var> object<a name="index-sb_002dqueue_003aqueuep-673"></a></var><br>
<blockquote><p><a name="index-sb_002dqueue_003aqueuep-674"></a>Returns true if argument is a <code>queue</code>, <code>nil</code> otherwise. 
</p></blockquote></div>

   </body></html>