[Y-devel] Proposal for a minor change in the Y-protocol

Andreas Karafyllis ankar at homodigitalis.net
Wed Apr 14 18:42:03 BST 2004


On Wednesday 14 April 2004 10:01, Andrew Suffield wrote:
> On Sun, Apr 11, 2004 at 02:51:30PM +0200, Andreas Karafyllis wrote:
> > If am currently implementing Eiffel-bindings for Y and I noticed thet the
> > way string are serialized as message-members can be improved.
> >
> > Currently (I am talking about the latest version after patch 33), a
> > string is serialized as following:
> > 00 - 03: Member length without this field
> > 04 - 07: Type information (0 for strings)
> > 08 - XX: The string including the 0 character.
>
> This is simply wrong. There are no terminators in wire strings. You
> just sent a string that has a \0 as the last character.
I did not know this when I wrote the email and some things are hard to guess if they are not documented.
This is already kindly explained from Richard Hills in a previous email.
>
> > With or without the null character there is still a small problem. The
> > next field could start in an address which is not 4-byte aligned. If the
> > next member is for example an integer, all its field wills be stored in
> > no 4-bytes aligend addresses. There are to reason I do not like it:
> > 1) It is ugly :-)
> > 2) Most modern  RISC processors do not work very happily with not-aligned
> > values. We should try to make serialization - deserialization as fast as
> > possible
>
> And this is insane. The protocol would change depending on hardware
> architecture, and it's pointless anyway, since none of the code in Y
> or libYc++ has alignment issues.
I cannot follow you here. Firstly, alignment does not make the protocol hardware depedent.
Secondly, I know that there are no alignement issues in the current implementation.
The whole idea was that they could be considered in the future.
Finally, I hope you don't mean the word "insane" seriously.
Even if the whole thing is bad or wrong, this is not the right way to say it.

Andreas




More information about the Y-devel mailing list









2026 © www.Y-Windows.Org - All Rights Reserved