Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
worker_thread Struct Reference

Data Fields

worker_state state
 Worker state is protected with our mutex.
 
uint8_t * in
 Input buffer that will contain the whole Block except Block Header.
 
size_t in_size
 Amount of memory allocated for "in".
 
size_t in_filled
 Number of bytes written to "in" by the main thread.
 
size_t in_pos
 Number of bytes consumed from "in" by the worker thread.
 
size_t out_pos
 
struct lzma_stream_codercoder
 
const lzma_allocatorallocator
 
lzma_outbufoutbuf
 Output queue buffer to which the uncompressed data is written.
 
size_t progress_in
 
size_t progress_out
 Like progress_in but for uncompressed data.
 
partial_update_mode partial_update
 
lzma_next_coder block_decoder
 Block decoder.
 
lzma_block block_options
 
uint64_t mem_filters
 Filter chain memory usage.
 
struct worker_threadnext
 Next structure in the stack of free worker threads.
 
mythread_mutex mutex
 
mythread_cond cond
 
mythread thread_id
 

Field Documentation

◆ allocator

const lzma_allocator * allocator

The allocator is set by the main thread. Since a copy of the pointer is kept here, the application must not change the allocator before calling lzma_end().

◆ block_decoder

lzma_next_coder block_decoder

Block decoder.

◆ block_options

lzma_block block_options

Thread-specific Block options are needed because the Block decoder modifies the struct given to it at initialization.

◆ coder

struct lzma_stream_coder * coder

Pointer to the main structure is needed to (1) lock the main mutex (coder->mutex) when updating outbuf->pos and (2) when putting this thread back to the stack of free threads.

◆ cond

mythread_cond cond

◆ in

uint8_t * in

Input buffer that will contain the whole Block except Block Header.

◆ in_filled

size_t in_filled

Number of bytes written to "in" by the main thread.

◆ in_pos

size_t in_pos

Number of bytes consumed from "in" by the worker thread.

◆ in_size

size_t in_size

Amount of memory allocated for "in".

◆ mem_filters

uint64_t mem_filters

Filter chain memory usage.

◆ mutex

mythread_mutex mutex

◆ next

struct worker_thread * next

Next structure in the stack of free worker threads.

◆ out_pos

size_t out_pos

Amount of uncompressed data that has been decoded. This local copy is needed because updating outbuf->pos requires locking the main mutex (coder->mutex).

◆ outbuf

lzma_outbuf * outbuf

Output queue buffer to which the uncompressed data is written.

◆ partial_update

partial_update_mode partial_update

Updating outbuf->pos requires locking the main mutex (coder->mutex). Since the main thread will only read output from the oldest outbuf in the queue, only the worker thread that is associated with the oldest outbuf needs to update its outbuf->pos. This avoids useless mutex contention that would happen if all worker threads were frequently locking the main mutex to update their outbuf->pos.

Only when partial_update is something else than PARTIAL_DISABLED, this worker thread will update outbuf->pos after each call to the Block decoder.

◆ progress_in

size_t progress_in

Amount of compressed data that has already been decompressed. This is updated from in_pos when our mutex is locked. This is size_t, not uint64_t, because per-thread progress is limited to sizes of allocated buffers.

◆ progress_out

size_t progress_out

Like progress_in but for uncompressed data.

◆ state

worker_state state

Worker state is protected with our mutex.

◆ thread_id

mythread thread_id

The ID of this thread is used to join the thread when it's not needed anymore.


The documentation for this struct was generated from the following files: