---
name: "bson_cross_platform_notes"
section: "3"
platform: "linux"
package: "libbson-doc"
version: "1.23.1-1+deb12u3"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/bson_cross_platform_notes"
---

# bson\_cross\_platform\_notes(3)

Cross Platform Notes

## NAME

bson\_cross\_platform\_notes - Cross Platform Notes

## ENDIANNESS

The BSON specification dictates that the encoding format is in little-endian. Many implementations simply ignore endianness altogether and expect that they are to be run on little-endian. Libbson supports both Big and Little Endian systems. This means we use **memcpy()** when appropriate instead of dereferencing and properly convert to and from the host endian format. We expect the compiler intrinsics to optimize it to a dereference when possible.

## THREADING

Libbson's data structures are *NOT* thread-safe. You are responsible for accessing and mutating these structures from one thread at a time.

Libbson requires POSIX threads (pthreads) on all UNIX-like platforms. On Windows, the native threading interface is used. Libbson uses your system's threading library to safely generate unique *ObjectIds*, and to provide a fallback implementation for atomic operations on platforms without built-in atomics.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2017-present, MongoDB, Inc
