GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  MEMCHAN (n)

NAME

memchan - Create and manipulate memory channels

CONTENTS

Synopsis
Description
Command
Keywords
Copyright

SYNOPSIS

package require Tcl

package require memchan

memchan ?-initial-size len?


   








\L’|0u-1v’\l’75u+3n_’\L’0u+1v-0u’\l’|0u-1.5n_’



\L’|0u-1v’\L’0u+1v-0u’\l’|0u-1.5n_’





DESCRIPTION

This manpage documents both the overall package and the command memchan. The package itself provides a number of in-memory channels which can utilized to
o capture stream-like information in a natural way instead of using set and append to manipulate strings
o or to transfer data between interpreters, in the same thread or not.

COMMAND

memchan ?-initial-size len?
  creates a chunk-oriented in-memory channel and returns its handle. If an initial size is specified the system will pre-allocate len bytes of buffer space for the contents. This is no restriction on the ultimate size of the channel, it will always grow as much as is necessary to accommodate the data written into it.

The channels created here can be transferred between interpreters in the same thread and between threads, but only as a whole. It is not possible to use them to create a bi- or unidirectional connection between two interpreters.

Memory channels created by memchan provide two read-only options which can be queried via the standard fconfigure command. These are
-length
  The value of this option is the number of bytes currently stored in the queried memory channel.
-allocated
  The value of this option is the number of bytes currently allocated by the queried memory channel. This number is at least as big as the value of -length.

As the channels generated by memchan grow as necessary they are always writable. This means that a writable fileevent-handler will fire continuously.

The channels are also readable if they contain more than zero bytes and the seek location is not and the end of the channel. Under these conditions a readable fileevent-handler will fire continuously.

Note that writing to such a channel usually occurs at the end, thus suppressing readable events. This also means that users have to take care to seek the channel to a location before the end before trying to read data back.

SEE ALSO

fifo, fifo2, null, random, zero

KEYWORDS

channel, chunk, i/o, in-memory channel, memchan

COPYRIGHT

Copyright (c) 1996-2003 Andreas Kupries <andreas_kupries@users.sourceforge.net>

Search for    or go to Top of page |  Section n |  Main Index


Memory channels MEMCHAN (n) 2&.2

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.