[ 
https://issues.apache.org/jira/browse/PDFBOX-2882?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Hewson reopened PDFBOX-2882:
---------------------------------

There are still problems with the close logic.

{code}
public void close() throws IOException
{
    if (isClosed)
    {
        return;
    }

    isClosed = true;

    IOException ioexc = null;
    
    synchronized (ioLock)
    {
        ....
{code}

isClosed is being used in a check-and-set without any synchronisation or 
atomicity. If two threads call close() at the same time, both will try to close 
and delete the file. (As previously mentioned, there's no need to track 
isClosed anyway).

> Improve performance when using scratch file
> -------------------------------------------
>
>                 Key: PDFBOX-2882
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2882
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: Parsing
>    Affects Versions: 2.0.0
>            Reporter: Timo Boehme
>            Assignee: Timo Boehme
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: ScratchFile.java, ScratchFileBuffer.java
>
>
> The current scratch file implementation uses many direct I/O calls which 
> slows down parsing compared with in-memory scratch buffer considerably.



--
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