Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
h2_workers.h
Go to the documentation of this file.
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements. See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef __mod_h2__h2_workers__
18 #define __mod_h2__h2_workers__
19 
20 /* Thread pool specific to executing h2_tasks. Has a minimum and maximum
21  * number of workers it creates. Starts with minimum workers and adds
22  * some on load, reduces the number again when idle.
23  *
24  */
25 struct apr_thread_mutex_t;
26 struct apr_thread_cond_t;
27 struct h2_mplx;
28 struct h2_request;
29 struct h2_task;
30 struct h2_fifo;
31 
32 struct h2_slot;
33 
34 typedef struct h2_workers h2_workers;
35 
36 struct h2_workers {
39 
44 
45  int aborted;
46  int dynamic;
47 
49  int nslots;
50  struct h2_slot *slots;
51 
53 
54  struct h2_slot *free;
55  struct h2_slot *idle;
56  struct h2_slot *zombies;
57 
58  struct h2_fifo *mplxs;
59 
61 };
62 
63 
64 /* Create a worker pool with the given minimum and maximum number of
65  * threads.
66  */
68  int min_size, int max_size, int idle_secs);
69 
76 
81 
82 #endif /* defined(__mod_h2__h2_workers__) */
Definition: h2_task.h:53
Definition: h2_mplx.h:57
Definition: apr_arch_thread_mutex.h:28
server_rec * s
Definition: h2_workers.h:37
apr_status_t h2_workers_register(h2_workers *workers, struct h2_mplx *m)
int max_idle_secs
Definition: h2_workers.h:43
apr_uint32_t min_workers
Definition: h2_workers.h:41
apr_bucket_brigade request_rec apr_pool_t * pool
Definition: mod_dav.h:552
Definition: h2.h:133
apr_pool_t * pool
Definition: h2_workers.h:38
volatile apr_uint32_t worker_count
Definition: h2_workers.h:52
apr_status_t h2_workers_unregister(h2_workers *workers, struct h2_mplx *m)
struct h2_slot * zombies
Definition: h2_workers.h:56
struct apr_thread_mutex_t * lock
Definition: h2_workers.h:60
A structure to store information for each virtual server.
Definition: httpd.h:1311
int next_worker_id
Definition: h2_workers.h:40
struct h2_slot * free
Definition: h2_workers.h:54
apr_threadattr_t * thread_attr
Definition: h2_workers.h:48
unsigned int apr_uint32_t
Definition: apr.h:334
apr_uint32_t max_workers
Definition: h2_workers.h:42
int aborted
Definition: h2_workers.h:45
h2_workers * h2_workers_create(server_rec *s, apr_pool_t *pool, int min_size, int max_size, int idle_secs)
struct h2_slot * slots
Definition: h2_workers.h:50
Definition: apr_arch_threadproc.h:50
int dynamic
Definition: h2_workers.h:46
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
int apr_status_t
Definition: apr_errno.h:44
Definition: apr_arch_thread_cond.h:34
Definition: h2_workers.h:36
struct h2_fifo * mplxs
Definition: h2_workers.h:58
struct h2_fifo h2_fifo
Definition: h2_util.h:196
int nslots
Definition: h2_workers.h:49
struct h2_slot * idle
Definition: h2_workers.h:55