[cairo] concurrent text rendering issue

Kozhevnikov Mikhail mikhailkozhevnikov at yandex.ru
Tue Mar 30 02:48:09 PDT 2010


While my previous email is awaiting moderator approval, having 140Kb attachment, I've worked out the solution, more or less.

The point is, cairo_show_text and cairo_text_extents are not thread safe on Windows, at least when using default font backend. I'm not quite sure they're supposed to be thread safe, but so they appear on Linux.


28.03.10, 22:08, "Kozhevnikov Mikhail" <mikhailkozhevnikov at yandex.ru>:

> Hi All,
>  I'm getting an error when renderig text concurrently on Windows.
>  Here's the experiment: we render repeatedly a set of letters in different font sizes. Neither letters, nor font sizes change from iteration to iteration. If we do it with one thread, it works fine and we get consistent results. If we use more of them, the output varies - some letters are missing. Sometimes an out of memory error is reported. See the sample images and code attached (only unique images are stored).
>  I've found out that it only happens on Windows. Thus I suspect that this issue has to do with WinAPI font selection mechanism. For example, if we confine ourselves to one single font size, we wouldn't experience any problems.
>  Could anyone suggest a way to fix that? Should it be considered a bug at all?
>  Thanks in advance,
>  Mikhail.

More information about the cairo mailing list