source: trunk/README-threaded.txt @ 77

Revision 77, 1.5 KB checked in by faltet, 3 years ago (diff)

Merged the 'threaded' branch.

That branch is fairly stable now and has been thoroughly tested. From
now on, Blosc will support threads by default. The drawback is that you
will need to use a threads implementatation, but this is only a relative
problem on Windows, where you have to install the pthread-win32 library.

Line 
1Blosc supports threads now
2==========================
3
4It just happened: Blosc can be run in threaded mode for both
5compressing and decompressing.  However, threaded Blosc doesn't work
6better than the serial version in all cases and the reason is that
7threads, and most specially, the cost of synchronization between them.
8
9In order to reduce the overhead of threads as much as possible, I've
10decided to implement a pool of threads (the workers) that are waiting
11for the main process (the master) to send them jobs (basically,
12compressing and decompressing small blocks of the initial buffer).
13
14Despite this and many other internal optimizations in the threaded
15code, it does not work faster than the serial version for buffer sizes
16around 128 KB or less (Intel Quad Core2 / Linux).  This is why Blosc
17falls back to use the serial version for such a 'small' buffers.
18
19In contrast, for buffers larger than 128 KB, the threaded version
20starts to behave significantly better, being the sweet point at 1 MB.
21For larger buffer sizes than 1 MB, the threaded code slows down, but
22it is still considerably faster than serial code.
23
24For this reason, I decided that Blosc will automatically enable the
25threaded version only when the buffer to be compressed/decompressed
26would be larger than 128 KB, while still using the serial version for
27smaller buffer sizes.
28
29The 128 KB limit might seem a bit arbitrary, and certainly is.  I
30still have to study other multi-core processors to fine-tune this.
31
32Francesc Alted
332010-04-28
Note: See TracBrowser for help on using the repository browser.