[ 
https://issues.apache.org/jira/browse/PDFBOX-3267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15301966#comment-15301966
 ] 

Andreas Lehmkühler edited comment on PDFBOX-3267 at 5/26/16 11:52 AM:
----------------------------------------------------------------------

charStringCache is a ConcurrentHashMap which eliminates some of the possible 
issues when using more than one thread. But all members of the map have to be 
implemented thread safe as well and Type1CharString isn't thread safe. I've 
synchronized the render part in getBounds, getWidth and getPath and everything 
works as expected, see attached patch.


was (Author: lehmi):
charStringCache is a ConcurrentHashMap which eliminates some of the possible 
issues when using more than one thread. But all members of the map have to be 
implemented thread safe as well and Type1CharString isn't thread safe. I've 
synchronized the render part in getBounds, getWidth and getPath and everything 
works as expected.

> Using threads results in different images
> -----------------------------------------
>
>                 Key: PDFBOX-3267
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3267
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 2.0.0
>            Reporter: simon steiner
>         Attachments: ComparePDF.java, Type1CharString_sync_patch.txt, 
> bmpwithdpi.pdf, bmpwithdpi2.pdf, syncicc.patch, t1.png, t2.png
>
>
> If i dont use threads images are the same
> java -cp pdf-box-svn/app/target/pdfbox-app-2.0.0-SNAPSHOT.jar:. ComparePDF
> Exception in thread "main" java.io.IOException: Not equals
>       at ComparePDF.main(ComparePDF.java:21)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to