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

Rogelio Serrano rogelio at smsglobal.net
Mon Apr 12 02:14:29 BST 2004


On 2004-04-12 05:52:08 +0800 Andreas Karafyllis 
<ankar at homodigitalis.net> wrote:

> On Sunday 11 April 2004 21:24, Richard Hills wrote:
>> Hey,
>> 
>>> > In the comments in the libYc is written thet the '\0' may 
>>> be not used
>>> > in the future. I go for it. The '\0' is not needed. You 
>>> should depend
>>> > to "member length" field find how big the string is. And 
>>> null
>>> > terminated strings are a bad idea anyway. A very nice 
>>> article about
>>> > this topic is the following:
>>> > https://www.joelonsoftware.com/articles/fog0000000319.html
>> 
>>         As far as I understand the \0 isn't needed, but when I was 
>> writing that
>> part of libYc it was easier at the time to just include it. 
>> Neither the
>> server nor libYc clients rely on it.
> 
> Ok, nice to hear this...
> 
>> 
>>> 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
>> 
>>         I don't really think it's that ugly. And although we want
>> deserialization to go fast, I don't think this will have a 
>> significant
>> effect on speed. If you can point out a protocol which does 
>> align
>> everything to the nearest 4 bytes for this reason I'd be 
>> interested to
>> see it.
>> 
> No, I do not have a specific protocol in mind. I would 
> investigate it if  I 
> find time. Perhaps in recent protocols is taken into account.
> I only know that processors like ARM need more cycles to 
> read/write not 
> aligned 32-bit values. I assume the same happens with PowerPC. 
> In x86 should 
> not make any difference I think.
> I agree that the speed improvement will be small. The amount 
> of time to 
> serialize/deserialize must be relatively small compared to the 
> time a socket 
> transaction needs. The reasons I made the proposal are more 
> "aesthetic" than 
> functional. It is of course subjective, if something is ugly 
> or not, and I 
> will not argue further :-)
> 
> Andreas
> 
> 
> 

I think osf rpc and dce rpc does this exactly for the same 
reason. all my netwroking does this because if i dont a cast of 
the data in a buffer to an int on a big endian machine like the 
dragonball will cause a bus error or a segfault.




More information about the Y-devel mailing list









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