All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
h2_workers.h File Reference

Go to the source code of this file.

Data Structures

struct  h2_workers


typedef struct h2_workers h2_workers


h2_workersh2_workers_create (server_rec *s, apr_pool_t *pool, int min_size, int max_size, apr_size_t max_tx_handles)
void h2_workers_destroy (h2_workers *workers)
apr_status_t h2_workers_register (h2_workers *workers, struct h2_mplx *m)
apr_status_t h2_workers_unregister (h2_workers *workers, struct h2_mplx *m)
void h2_workers_set_max_idle_secs (h2_workers *workers, int idle_secs)
apr_size_t h2_workers_tx_reserve (h2_workers *workers, apr_size_t count)
void h2_workers_tx_free (h2_workers *workers, apr_size_t count)

Typedef Documentation

typedef struct h2_workers h2_workers

Function Documentation

h2_workers* h2_workers_create ( server_rec s,
apr_pool_t pool,
int  min_size,
int  max_size,
apr_size_t  max_tx_handles 
void h2_workers_destroy ( h2_workers workers)
apr_status_t h2_workers_register ( h2_workers workers,
struct h2_mplx m 

Registers a h2_mplx for task scheduling. If this h2_mplx runs out of tasks, it will be automatically be unregistered. Should new tasks arrive, it needs to be registered again.

void h2_workers_set_max_idle_secs ( h2_workers workers,
int  idle_secs 

Set the amount of seconds a h2_worker should wait for new tasks before shutting down (if there are more than the minimum number of workers).

void h2_workers_tx_free ( h2_workers workers,
apr_size_t  count 

Return a number of reserved file handles back to the pool. The number overall may not exceed the numbers reserved.

workersthe workers instance
counthow many handles are returned to the pool
apr_size_t h2_workers_tx_reserve ( h2_workers workers,
apr_size_t  count 

Reservation of file handles available for transfer between workers and master connections.

When handling output from request processing, file handles are often encountered when static files are served. The most efficient way is then to forward the handle itself to the master connection where it can be read or sendfile'd to the client. But file handles are a scarce resource, so there needs to be a limit on how many handles are transferred this way.

h2_workers keeps track of the number of reserved handles and observes a configurable maximum value.

workersthe workers instance
counthow many handles the caller wishes to reserve
the number of reserved handles, may be 0.
apr_status_t h2_workers_unregister ( h2_workers workers,
struct h2_mplx m 

Remove a h2_mplx from the worker registry.