guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: data type ByteBuffer


From: Steven Wu
Subject: Re: data type ByteBuffer
Date: Sat, 8 May 2004 09:09:16 -0700


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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]