Sophie

Sophie

distrib > Fedora > 15 > x86_64 > by-pkgid > c521da20bd4948864cf5bcbab78d30e5 > files > 7

memchan-2.2.1-8.fc15.x86_64.rpm

<! -- -*- tcl -*- doctools
   -->
<html><head><title>fifo2 - Memory channels </title></head>
<! -- Generated from file 'fifo2.man' by tcllib/doctools with format 'html'
   -->
<! -- Copyright (c) 1996-2003 Andreas Kupries &lt;andreas_kupries@users.sourceforge.net&gt;
   -->
<! -- CVS: $Id$ fifo2.n
   -->

<h1> fifo2(n) 2.2  &quot;Memory channels&quot;</h1>
<a name="name"><h2>NAME</h2>
<p> fifo2 - Create and manipulate pipe fifo channels





<a name="synopsis"><h2>SYNOPSIS</h2>
package require <b>Tcl</b><br>
package require <b>memchan</b><br>
<br><table border=1 width=100% cellspacing=0 cellpadding=0><tr            bgcolor=lightyellow><td bgcolor=lightyellow><table 0 width=100% cellspacing=0 cellpadding=0><tr valign=top ><td ><b class='cmd'>fifo2</b> </td></tr>
</table></td></tr></table>
<a name="description"><h2>DESCRIPTION</h2>
<p>
The command described here is only available in a not-yet released
version of the package. Use the CVS to get the sources.

<dl>

<dt><b class='cmd'>fifo2</b> <dd>


creates two stream-oriented in-memory channels and returns their
handles as a two-element list. There is no restriction on the ultimate
size of the channels, they will always grow as much as is necessary to
accomodate the data written into them.

<br><br>
In contrast to the channels generated by <b class='cmd'>fifo</b> a pair of channels
created here is connected internally in such a way that data written
into one channel can be read from the other. All data written into
them is read in the same order. This also means that the two channels
of the pair are not seekable.

<br><br>
The channels created here can be transfered between interpreters in
the same thread and between threads. As both channels in the pair can
be transfered independently they can be used to create a bidirectional
connection between two interpreters.

</dl>
<p>
Memory channels created by <b class='cmd'>fifo2</b> provide two read-only options
which can be queried via the standard <b class='cmd'>fconfigure</b> command. These
are

<dl>
	<dt>-rlength<dd>

	The value of this option is the number of bytes currently
	available for reading from the channel.

	<br><br>
<dt>-wlength<dd>

	The value of this option is the number of bytes currently
	written into the channel.	
</dl>
<p>
Note that the two lengths are switched for the channels of a pair. In
other words, the number of bytes written for one of the channels is
the number of bytes readable from the other end.

<p>
As the channels generated by <b class='cmd'>fifo2</b> grow as necessary they are
always writable. This means that a writable <b class='cmd'>fileevent</b>-handler
will fire continuously.

<p>
The channels are also readable if they contain more than zero
bytes. Under this conditions a readable <b class='cmd'>fileevent</b>-handler will
fire continuously.

<a name="seealso"><h2>SEE ALSO</h2>
memchan, fifo, null
<a name="keywords"><h2>KEYWORDS</h2>
fifo, stream, memchan, in-memory channel, channel, i/o
<a name="copyright"><h2>COPYRIGHT</h2>
Copyright (c) 1996-2003 Andreas Kupries &lt;andreas_kupries@users.sourceforge.net&gt;<br>
</body></html>