[gs-bugs] [Bug 692918] Concurrency issue....

bugzilla-daemon at ghostscript.com bugzilla-daemon at ghostscript.com
Wed Mar 14 16:24:29 UTC 2012


http://bugs.ghostscript.com/show_bug.cgi?id=692918

Robin Watts <robin.watts at artifex.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |robin.watts at artifex.com
         Resolution|                            |INVALID

--- Comment #1 from Robin Watts <robin.watts at artifex.com> 2012-03-14 16:24:28 UTC ---
I need to update the doc/overview.txt Multi-threading section to be clearer
here.

When you create a fz_document, that document becomes bound to that context. You
can only then access that document with that given context.

That is to say, that if you enforce a strict '1-context for each thread'
policy, you can only ever access the document from one thread.

So the general scheme under which I forsee people using the code is to have one
thread that opens the documents, and then requests pages/makes display lists
from it. These display lists can then be rendered by other threads (with other
contexts) with no worries about concurrency.

An alternative way of working would be to do as you do, and to introduce your
own locking to ensure that only 1 thread is calling into the load_page/run_page
code at a time (and hence only one thread is using the context to which the
document is bound).

So, this isn't a bug, except in as much as the documentation should make this
clearer. I hope my explanation makes sense - if not, please say!

Thanks.

-- 
Configure bugmail: http://bugs.ghostscript.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the gs-bugs mailing list