<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Line drawing not thread-safe"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=74355">74355</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>chris@chris-wilson.co.uk
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Line drawing not thread-safe
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>cairo-bugs@cairographics.org
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>major
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows (All)
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>hguijtra@xs4all.nl
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>1.10.2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>image backend
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>cairo
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I'm drawing graphs with lots (millions) of tiny line pieces. To speed up this
process I used multiple threads to draw the line pieces. This greatly improves
performance, but typically causes a crash within a few minutes.

I've tried to do this in two ways:

1. share a single cairo_surface_t between the threads, and have each thread
draw using its own cairo_t. This crashes, but maybe I'm hoping for too much
(although an image surface is essentially just a big array of bytes that should
be writable from multiple threads). 

2. create a cairo_surface_t and cairo_t for each thread, and merge the results
after drawing has completed. This crashes in pixman. The only Cairo calls that
happen on a per-thread basis are cairo_set_line_cap, cairo_set_source_rgba,
cairo_set_line_width, cairo_set_dash, cairo_move_to, cairo_line_to, and
cairo_stroke.

Because I'm using the Gnome binary DLLs from
<a href="http://www.gtk.org/download/win32.php">http://www.gtk.org/download/win32.php</a> I cannot provide a meaningful stacktrace.
I have tried compiling a later version of Cairo but although I managed to
compile it, the resulting DLL is utterly unstable on Windows. However, I do
believe this might have something to do with the problem described at
<a href="http://lists.freedesktop.org/archives/cairo/2011-July/022123.html">http://lists.freedesktop.org/archives/cairo/2011-July/022123.html</a>.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>