From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Steven Wu" Newsgroups: gmane.lisp.guile.devel Subject: Re: data type ByteBuffer Date: Sat, 8 May 2004 09:09:16 -0700 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <0E16EB13-A10A-11D8-AB59-000A958866C4@qwest.net> References: <92C45B78-9F30-11D8-BD05-000A958866C4@qwest.net> <1084031082.3050.19.camel@localhost> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (Apple Message framework v613) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1084032676 13097 80.91.224.253 (8 May 2004 16:11:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 8 May 2004 16:11:16 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat May 08 18:11:08 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BMUPr-0000EK-00 for ; Sat, 08 May 2004 18:11:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.33) id 1BMUOs-0005Zw-6Y for guile-devel@m.gmane.org; Sat, 08 May 2004 12:10:06 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.33) id 1BMUOn-0005ZO-70 for guile-devel@gnu.org; Sat, 08 May 2004 12:10:01 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.33) id 1BMUOH-0005Ux-20 for guile-devel@gnu.org; Sat, 08 May 2004 12:10:00 -0400 Original-Received: from [63.231.195.113] (helo=mpls-qmqp-02.inet.qwest.net) by monty-python.gnu.org with smtp (Exim 4.33) id 1BMUOG-0005SV-KZ for guile-devel@gnu.org; Sat, 08 May 2004 12:09:28 -0400 Original-Received: (qmail 75530 invoked by uid 0); 8 May 2004 15:05:35 -0000 Original-Received: from mpls-pop-02.inet.qwest.net (63.231.195.2) by mpls-qmqp-02.inet.qwest.net with QMQP; 8 May 2004 15:05:35 -0000 Original-Received: from 63-226-26-178.phnx.qwest.net (HELO ?10.0.0.5?) (63.226.26.178) by mpls-pop-02.inet.qwest.net with SMTP; 8 May 2004 16:09:27 -0000 Original-To: "Clinton Ebadi" In-Reply-To: <1084031082.3050.19.camel@localhost> X-Mailer: Apple Mail (2.613) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:3686 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:3686 On May 8, 2004, at 8:44 AM, Clinton Ebadi wrote: > On Thu, 2004-05-06 at 03:39, Steven Wu wrote: >> I wonder if there is a built-in simple data type like ByteBuffer in >> Java, or Message_Block in ACE. It seems to me, when dealing with >> network programing, such a data type can be very efficient. The >> Message_Block in ACE emulates SysV message block used in device driver >> with reference counting, and the concept of adding continue blocks. It >> shouldn't be very hard to implement the similar thing in guile. >> >> steve > > Would a uniform byte vector (or array if you need more than one > dimension) work? > > (make-uniform-vector size #\nul &fill) > uniform vector can be used to implement the Message_Block, or Message_Block, however, if we extend the guile and make Message_Block into a compound type, it certainly increase the efficiency. The difference between uniform vector and Message_Block is that the Message_Block is a list of uniform vectors, but it is seen to users as one continuous block. Especially, when it can be easily convert to iovec, and write to a fd with one sys-call writev, and that is certainly more effective then multiple write. steve _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel