<page xmlns="http://projectmallard.org/1.0/"
      type="topic"
      id="threading">

  <info><link type="guide" xref="index#xplat"/></info>
  <title>Threading</title>
  <p>Libbson is <em>NOT</em> thread-safe, but it is thread-aware. Libbson requires POSIX threads (pthreads) on all UNIX-like platforms. On Windows, the native threading interface is used.</p>
  <p>You, the API consumer, are responsible for managing the data-structures in way that results two threads are not mutating at the same time. You may also want to bear in mind your platform may have ordering and consistency concerns that should also be followed.</p>
  <p>Libbson used threading primatives for controlling state internal to the library as well as providing atomic fallbacks during <link xref="bson_oid_t">ObjectID</link> generation.</p>

</page>
