[HarfBuzz] To HB_NO_MT or not to HB_NO_MT

Konstantin Ritt ritt.ks at gmail.com
Sat Mar 28 12:28:36 PDT 2015

Hi list,

Intro: the configure script tries to detect the Intel and Solaris atomic
primitives/ops support and if that failed, HB falls back to the
thread-unsafe default implementation and warns the user (and also proposes
to suppress the warning by defining HB_NO_MT ;) ). Moreover, HB_NO_MT is
the only alternative suggested by Android.mk (though docs/ANDROID-ATOMICS.htm
says the atomics are supported)!

Issue: in a multi-threaded application, there is no possibility to check if
HB library we're linking to is thread-safe -> we blindly assume it is.

Proposed solution: in case the configure script failed to detect the
supported atomic primitives, proceed with a warning and expect the build to
fail if the user didn't provide his own implementation (ie. in config.h or
via some external include). This way, we could even get rid of HB_NO_MT
path -- where explicitly required, the user would be able to provide his
no-MT implementation (ie. for HB built in a single-threaded application).


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/harfbuzz/attachments/20150328/c1daaaab/attachment.html>

More information about the HarfBuzz mailing list