Wydawca (split by section):   Section:   Chapter:FastBack: Reporting Bugs   Up: Top   FastForward: Copying This Manual   Contents: Table of ContentsIndex: Concept Index

Appendix A Architecture of the Wydawca

This appendix outlines the structure of the program. It serves as a short reminder for debugging the program.

A running wydawca process consists of at least four threads. Each upload is processed by its dedicated thread. Additional threads can be strarted to perform some specific tasks.

If the operating system permits, each thread is assigned a name. Apart from the main thread, names of each thread begin with uppercase letters WY plus underscore.

On a GNU/Linux system the name of a thread can be read from /proc/pid/task/tid/comm, where pid is the PID of the wydawca process and tid is the thread identifier.

The following table describes each thread:

wydawca

The main thread. It starts all other threads and waits for signals. When it exits, all other threads are terminated as well.

WY_listener

The workhorse of the project. Listens on inotify descriptor and TCP socket for incoming notification events. This thread keeps a table of uploaded files, which is updated each time an inotify event is reported. Uploaded files are verified and ordered into triplets. Once a triplet is completed, a separate ‘WY_triplet’ thread is started in order to process it.

If an incoming connection appears on upload notification socket (see upload notification), a ‘WY_tcpmux’ thread is started to handle it.

WY_tricleaner

Keeps track of registered triplets and removes expired ones.

WY_stat

This thread is responsible for statistic logging and notification.

WY_connwatch

This thread is started by if the legacy upload notification is enabled (see listen). It enforces idle timeout for all started upload notification threads (‘WY_tcpmux’ instances).

WY_tcpmux

Serves a particular notification upload connection. The number of threads of this type is limited by the max-connections configuration file statement (see max-connections).

WY_triplet

Processes a triplet. A separate thread of this type is started by ‘WY_listener’ for each valid triplet it detects.

Wydawca (split by section):   Section:   Chapter:FastBack: Reporting Bugs   Up: Top   FastForward: Copying This Manual   Contents: Table of ContentsIndex: Concept Index