[Patch] C1X threading support

Warner Losh imp at bsdimp.com
Wed Dec 21 17:47:18 UTC 2011


On Dec 21, 2011, at 8:16 AM, Dag-Erling Smørgrav wrote:

> "O. Hartmann" <ohartman at zedat.fu-berlin.de> writes:
>> How is the other BSD sibbling, NetBSD, dealing with such things? NetBSD
>> is supposed to run on a trmendous variety of hardware, even a mixture of
>> bigendian and littleenddian and I'm quite sure they must have overcome
>> this probleme anyway.
> 
> The same way FreeBSD does: where ordering matters, use explicit
> conversions when reading and writing.  The conversion functions / macros
> are defined in such a manner that unnecessary conversions (e.g. host to
> little-endian on a little-endian system) do not generate any code at
> all.  The only downside is that you can't directly compare variables
> unless you're certain that they're both in host order.

And it is difficult for automated tools to help you know if you are "sure" or not.

Warner



More information about the freebsd-threads mailing list