[zeromq-dev] Non-contiguous message thoughts

Martin Sustrik sustrik at 250bpm.com
Sun Mar 7 21:53:04 CET 2010


Chuck,

> Any issues with non-aligned access? I realize the format already
> causes that for the large message case (> 254 bytes).
> 
> I only ask because most processors these days are optimized for
> access aligned along the 4-byte boundary (or perhaps it doesn't
> matter anymore).


I don't believe it matters even for messages > 254 bytes long. The data 
are passed between NIC and userland as unstructured BLOB, thus alignment 
issues are irrelevant. At kernel/user-space boundary, messages are 
immediately decoded and message size is stored in perfectly aligned 
manner. Thus there's at most 1 unaligned access per message - a fraction 
of nanosecond presumably.

Same for the proposed 'flags' field, but the fact that it's only a 
single byte makes the issue even more negligible.

Martin



More information about the zeromq-dev mailing list