openexr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Openexr-devel] Thread safety


From: jcupitt
Subject: Re: [Openexr-devel] Thread safety
Date: Wed, 3 Apr 2013 17:52:08 +0100

On 3 April 2013 00:01, Peter Hillman <address@hidden> wrote:
> There is a mechanism for DeepScanlineInputFile/Part that allows two separate
> threads to read scanlines more efficiently. Instead of calling
> setFrameBuffer, you can call rawPixelData from each thread (locking to
> ensure the calls serialise) then call the versions of readPixelSampleCounts
> and readPixels that take a FrameBuffer and the rawdata. This allows
> simultaneous decompression/pixel copying of data. It has to be used with
> care, and is probably only useful as a last resort for maximising
> performance.

OpenSlide has a nice solution to this: they lock for the tile read,
but do their jp2k decompress outside the lock. So reading with several
threads doesn't cause terrible IO thrashing, but does give a good
speedup.

As you say, for best performance you need something in the client to
order reads and to prevent repeated decompression between threads.
It's probably sensible to keep that outside the core library.

John



reply via email to

[Prev in Thread] Current Thread [Next in Thread]