Added: apr/site/trunk/docs/docs/apr/trunk/group___a_p_r___util___r_l.html URL: http://svn.apache.org/viewvc/apr/site/trunk/docs/docs/apr/trunk/group___a_p_r___util___r_l.html?rev=784636&view=auto ============================================================================== --- apr/site/trunk/docs/docs/apr/trunk/group___a_p_r___util___r_l.html (added) +++ apr/site/trunk/docs/docs/apr/trunk/group___a_p_r___util___r_l.html Mon Jun 15 00:01:38 2009 @@ -0,0 +1,265 @@ + + +Apache Portable Runtime: Resource List Routines + + + + + +
+

Resource List Routines
+ +[APR Utility Functions] +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Defines

#define APR_RESLIST_CLEANUP_DEFAULT   0
#define APR_RESLIST_CLEANUP_FIRST   1

Typedefs

typedef struct apr_reslist_t apr_reslist_t
+typedef apr_status_t(* apr_reslist_constructor )(void **resource, void *params, apr_pool_t *pool)
+typedef apr_status_t(* apr_reslist_destructor )(void *resource, void *params, apr_pool_t *pool)

Functions

 APU_DECLARE (apr_status_t) apr_reslist_create(apr_reslist_t **reslist
 APU_DECLARE (void) apr_reslist_timeout_set(apr_reslist_t *reslist
 APU_DECLARE (apr_uint32_t) apr_reslist_acquired_count(apr_reslist_t *reslist)

Variables

+int min
+int int smax
+int int int hmax
+int int int apr_interval_time_t ttl
+int int int
+apr_interval_time_t
+apr_reslist_constructor 
con
+int int int
+apr_interval_time_t
+apr_reslist_constructor
+apr_reslist_destructor 
de
+int int int
+apr_interval_time_t
+apr_reslist_constructor
+apr_reslist_destructor void * 
params
+int int int
+apr_interval_time_t
+apr_reslist_constructor
+apr_reslist_destructor void
+apr_pool_t
pool
+void ** resource
+apr_interval_time_t timeout
+apr_uint32_t mode
+

Define Documentation

+ +
+
+ + + + +
#define APR_RESLIST_CLEANUP_DEFAULT   0
+
+
+ +

+default pool cleanup +

+

+ +

+
+ + + + +
#define APR_RESLIST_CLEANUP_FIRST   1
+
+
+ +

+use pool pre cleanup +

+

+


Typedef Documentation

+ +
+
+ + + + +
typedef struct apr_reslist_t apr_reslist_t
+
+
+ +

+Opaque resource list object +

+

+


Function Documentation

+ +
+
+ + + + + + + + + +
APU_DECLARE (apr_uint32_t   ) 
+
+
+ +

+Return the number of outstanding resources.

Parameters:
+ + +
reslist The resource list.
+
+Creates a crc32 hash used to split keys between servers
Parameters:
+ + + +
data Data to be hashed
data_len Length of the data to use
+
+
Returns:
crc32 hash of data
+
Remarks:
The crc32 hash is not compatible with old memcached clients.
+Pure CRC32 Hash. Used by some clients.

+hash compatible with the standard Perl Client. +

+

+ +

+
+ + + + + + + + + +
APU_DECLARE (void   ) 
+
+
+ +

+Set the timeout the acquire will wait for a free resource when the maximum number of resources is exceeded.

Parameters:
+ + + +
reslist The resource list.
timeout Timeout to wait. The zero waits forever.
+
+Set reslist cleanup order.
Parameters:
+ + + +
reslist The resource list.
mode Cleanup order mode
+           APR_RESLIST_CLEANUP_DEFAULT  default pool cleanup order
+           APR_RESLIST_CLEANUP_FIRST    use pool pre cleanup
+ 
+
+
Remarks:
If APR_RESLIST_CLEANUP_FIRST is used the destructors will be called before child pools of the pool used to create the reslist are destroyed. This allows to explicitly destroy the child pools inside reslist destructors.
+ +
+

+ +

+
+ + + + + + + + + +
APU_DECLARE (apr_status_t   ) 
+
+
+ +

+Create a new resource list with the following parameters:

Parameters:
+ + + + + + + + + + +
reslist An address where the pointer to the new resource list will be stored.
min Allowed minimum number of available resources. Zero creates new resources only when needed.
smax Resources will be destroyed to meet this maximum restriction as they expire.
hmax Absolute maximum limit on the number of total resources.
ttl If non-zero, sets the maximum amount of time a resource may be available while exceeding the soft limit.
con Constructor routine that is called to create a new resource.
de Destructor routine that is called to destroy an expired resource.
params Passed to constructor and deconstructor
pool The pool from which to create this resource list. Also the same pool that is passed to the constructor and destructor routines.
+
+
Remarks:
If APR has been compiled without thread support, hmax will be automatically set to 1 and values of min and smax will be forced to 1 for any non-zero value.
+Destroy the given resource list and all resources controlled by this list. FIXME: Should this block until all resources become available, or maybe just destroy all the free ones, or maybe destroy them even though they might be in use by something else? Currently it will abort if there are resources that haven't been released, so there is an assumption that all resources have been released to the list before calling this function.
Parameters:
+ + +
reslist The reslist to destroy
+
+Retrieve a resource from the list, creating a new one if necessary. If we have met our maximum number of resources, we will block until one becomes available.

+Return a resource back to the list of available resources.

+Invalidate a resource in the pool - e.g. a database connection that returns a "lost connection" error and can't be restored. Use this instead of apr_reslist_release if the resource is bad.

+Perform routine maintenance on the resource list. This call may instantiate new resources or expire old resources.

Parameters:
+ + +
reslist The resource list.
+
+ +
+

+

+
Generated on Mon Jun 15 09:45:30 2009 for Apache Portable Runtime by  + +doxygen 1.5.8
+ + Added: apr/site/trunk/docs/docs/apr/trunk/group___a_p_r___util___r_m_m.html URL: http://svn.apache.org/viewvc/apr/site/trunk/docs/docs/apr/trunk/group___a_p_r___util___r_m_m.html?rev=784636&view=auto ============================================================================== --- apr/site/trunk/docs/docs/apr/trunk/group___a_p_r___util___r_m_m.html (added) +++ apr/site/trunk/docs/docs/apr/trunk/group___a_p_r___util___r_m_m.html Mon Jun 15 00:01:38 2009 @@ -0,0 +1,319 @@ + + +Apache Portable Runtime: Relocatable Memory Management Routines + + + + + +
+

Relocatable Memory Management Routines
+ +[APR Utility Functions] +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Typedefs

typedef struct apr_rmm_t apr_rmm_t
typedef apr_size_t apr_rmm_off_t

Functions

 APU_DECLARE (apr_status_t) apr_rmm_init(apr_rmm_t **rmm
 APU_DECLARE (apr_rmm_off_t) apr_rmm_malloc(apr_rmm_t *rmm
 APU_DECLARE (void *) apr_rmm_addr_get(apr_rmm_t *rmm
 APU_DECLARE (apr_size_t) apr_rmm_overhead_get(int n)

Variables

+apr_anylock_tlock
+apr_anylock_t void * membuf
+apr_anylock_t void apr_size_t memsize
+apr_anylock_t void apr_size_t
+apr_pool_t
cont
+apr_size_t reqsize
+void * entity
+

Typedef Documentation

+ +
+
+ + + + +
typedef apr_size_t apr_rmm_off_t
+
+
+ +

+Fundamental allocation unit, within a specific apr_rmm_t +

+

+ +

+
+ + + + +
typedef struct apr_rmm_t apr_rmm_t
+
+
+ +

+Structure to access Relocatable, Managed Memory +

+

+


Function Documentation

+ +
+
+ + + + + + + + + +
APU_DECLARE (apr_size_t   ) 
+
+
+ +

+Compute the required overallocation of memory needed to fit n allocs

Parameters:
+ + +
n The number of alloc/calloc regions desired
+
+Get the current number of scheduled tasks waiting in the queue
Parameters:
+ + +
me The thread pool
+
+
Returns:
Number of scheduled tasks in the queue
+Get the current number of threads
Parameters:
+ + +
me The thread pool
+
+
Returns:
Total number of threads
+Get the current number of busy threads
Parameters:
+ + +
me The thread pool
+
+
Returns:
Number of busy threads
+Get the current number of idle threads
Parameters:
+ + +
me The thread pool
+
+
Returns:
Number of idle threads
+Access function for the maximum number of idle threads. Number of current idle threads will be reduced to the new limit.
Parameters:
+ + + +
me The thread pool
cnt The number
+
+
Returns:
The number of threads that were stopped.
+Access function for the maximum number of idle threads
Parameters:
+ + +
me The thread pool
+
+
Returns:
The current maximum number
+Access function for the maximum number of threads.
Parameters:
+ + + +
me The thread pool
cnt Number of threads
+
+
Returns:
The original maximum number of threads
+Access function for the maximum number of threads
Parameters:
+ + +
me The thread pool
+
+
Returns:
The current maximum number
+Access function for the threshold of tasks in queue to trigger a new thread.
Parameters:
+ + + +
me The thread pool
cnt The new threshold
+
+
Returns:
The original threshold
+Access function for the threshold of tasks in queue to trigger a new thread.
Parameters:
+ + +
me The thread pool
+
+
Returns:
The current threshold
+ +
+

+ +

+
+ + + + + + + + + +
APU_DECLARE (void *   ) 
+
+
+ +

+Retrieve the physical address of a relocatable allocation of memory

Parameters:
+ + + +
rmm The relocatable memory block
entity The memory allocation to free
+
+
Returns:
address The address, aligned with APR_ALIGN_DEFAULT.
+ +
+

+ +

+
+ + + + + + + + + +
APU_DECLARE (apr_rmm_off_t   ) 
+
+
+ +

+Allocate memory from the block of relocatable memory.

Parameters:
+ + + +
rmm The relocatable memory block
reqsize How much memory to allocate
+
+Realloc memory from the block of relocatable memory.
Parameters:
+ + + + +
rmm The relocatable memory block
entity The memory allocation to realloc
reqsize The new size
+
+Allocate memory from the block of relocatable memory and initialize it to zero.
Parameters:
+ + + +
rmm The relocatable memory block
reqsize How much memory to allocate
+
+Compute the offset of a relocatable allocation of memory
Parameters:
+ + + +
rmm The relocatable memory block
entity The physical address to convert to an offset
+
+ +
+

+ +

+
+ + + + + + + + + +
APU_DECLARE (apr_status_t   ) 
+
+
+ +

+Initialize a relocatable memory block to be managed by the apr_rmm API.

Parameters:
+ + + + + + +
rmm The relocatable memory block
lock An apr_anylock_t of the appropriate type of lock, or NULL if no locking is required.
membuf The block of relocatable memory to be managed
memsize The size of relocatable memory block to be managed
cont The pool to use for local storage and management
+
+
Remarks:
Both
+
Parameters:
+ + + +
membuf and
memsize must be aligned (for instance using APR_ALIGN_DEFAULT).
+
+Destroy a managed memory block.
Parameters:
+ + +
rmm The relocatable memory block to destroy
+
+Attach to a relocatable memory block already managed by the apr_rmm API.
Parameters:
+ + + + + +
rmm The relocatable memory block
lock An apr_anylock_t of the appropriate type of lock
membuf The block of relocatable memory already under management
cont The pool to use for local storage and management
+
+Detach from the managed block of memory.
Parameters:
+ + +
rmm The relocatable memory block to detach from
+
+Free allocation returned by apr_rmm_malloc or apr_rmm_calloc.
Parameters:
+ + + +
rmm The relocatable memory block
entity The memory allocation to free
+
+ +
+

+

+
Generated on Mon Jun 15 09:45:30 2009 for Apache Portable Runtime by  + +doxygen 1.5.8
+ + Added: apr/site/trunk/docs/docs/apr/trunk/group___a_p_r___util___str_match.html URL: http://svn.apache.org/viewvc/apr/site/trunk/docs/docs/apr/trunk/group___a_p_r___util___str_match.html?rev=784636&view=auto ============================================================================== --- apr/site/trunk/docs/docs/apr/trunk/group___a_p_r___util___str_match.html (added) +++ apr/site/trunk/docs/docs/apr/trunk/group___a_p_r___util___str_match.html Mon Jun 15 00:01:38 2009 @@ -0,0 +1,128 @@ + + +Apache Portable Runtime: String matching routines + + + + + +
+

String matching routines
+ +[APR Utility Functions] +

+ + + + + + + + + + + + + + + + + + + +

Data Structures

struct  apr_strmatch_pattern

Typedefs

typedef struct apr_strmatch_pattern apr_strmatch_pattern

Functions

 APU_DECLARE (const char *) apr_strmatch(const apr_strmatch_pattern *pattern
 APU_DECLARE (const apr_strmatch_pattern *) apr_strmatch_precompile(apr_pool_t *p

Variables

+const char * s
+const char apr_size_t slen
+const char int case_sensitive
+

Typedef Documentation

+ +
+
+ + + + +
typedef struct apr_strmatch_pattern apr_strmatch_pattern
+
+
+ +

+

See also:
apr_strmatch_pattern
+ +
+

+


Function Documentation

+ +
+
+ + + + + + + + + +
APU_DECLARE (const apr_strmatch_pattern  ) 
+
+
+ +

+Precompile a pattern for matching using the Boyer-Moore-Horspool algorithm

Parameters:
+ + + + +
p The pool from which to allocate the pattern
s The pattern string
case_sensitive Whether the matching should be case-sensitive
+
+
Returns:
a pointer to the compiled pattern, or NULL if compilation fails
+ +
+

+ +

+
+ + + + + + + + + +
APU_DECLARE (const char *   )  const
+
+
+ +

+Search for a precompiled pattern within a string

Parameters:
+ + + + +
pattern The pattern
s The string in which to search for the pattern
slen The length of s (excluding null terminator)
+
+
Returns:
A pointer to the first instance of the pattern in s, or NULL if not found
+ +
+

+

+
Generated on Mon Jun 15 09:45:30 2009 for Apache Portable Runtime by  + +doxygen 1.5.8
+ + Added: apr/site/trunk/docs/docs/apr/trunk/group___a_p_r___util___t_p.html URL: http://svn.apache.org/viewvc/apr/site/trunk/docs/docs/apr/trunk/group___a_p_r___util___t_p.html?rev=784636&view=auto ============================================================================== --- apr/site/trunk/docs/docs/apr/trunk/group___a_p_r___util___t_p.html (added) +++ apr/site/trunk/docs/docs/apr/trunk/group___a_p_r___util___t_p.html Mon Jun 15 00:01:38 2009 @@ -0,0 +1,449 @@ + + +Apache Portable Runtime: Thread Pool routines + + + + + +
+

Thread Pool routines
+ +[APR Utility Functions] +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Defines

+#define APR_THREAD_TASK_PRIORITY_LOWEST   0
+#define APR_THREAD_TASK_PRIORITY_LOW   63
+#define APR_THREAD_TASK_PRIORITY_NORMAL   127
+#define APR_THREAD_TASK_PRIORITY_HIGH   191
+#define APR_THREAD_TASK_PRIORITY_HIGHEST   255

Typedefs

typedef struct apr_thread_pool apr_thread_pool_t

Functions

 APU_DECLARE (apr_status_t) apr_thread_pool_create(apr_thread_pool_t **me
 APU_DECLARE (apr_size_t) apr_thread_pool_tasks_count(apr_thread_pool_t *me)
 apr_thread_pool_tasks_run_count (apr_thread_pool_t *me)
 apr_thread_pool_tasks_high_count (apr_thread_pool_t *me)
 apr_thread_pool_threads_high_count (apr_thread_pool_t *me)
 apr_thread_pool_threads_idle_timeout_count (apr_thread_pool_t *me)
 apr_thread_pool_idle_wait_set (apr_thread_pool_t *me, apr_interval_time_t timeout)
 apr_thread_pool_idle_wait_get (apr_thread_pool_t *me)

Variables

+apr_size_t init_threads
+apr_size_t apr_size_t max_threads
+apr_size_t apr_size_t apr_pool_tpool
+apr_thread_start_t func
+apr_thread_start_t void * param
+apr_thread_start_t void apr_byte_t priority
+apr_thread_start_t void
+apr_byte_t void * 
owner
+apr_thread_start_t void
+apr_interval_time_t 
time
+apr_size_t cnt
+apr_size_t val
+

Typedef Documentation

+ +
+
+ + + + +
typedef struct apr_thread_pool apr_thread_pool_t
+
+
+ +

+Opaque Thread Pool structure. +

+

+


Function Documentation

+ +
+
+ + + + + + + + + +
apr_thread_pool_idle_wait_get (apr_thread_pool_t me  ) 
+
+
+ +

+Access function for the maximum wait time (in microseconds) of an idling thread that exceeds the maximum number of idling threads

Parameters:
+ + +
me The thread pool
+
+
Returns:
The current maximum wait time
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + +
apr_thread_pool_idle_wait_set (apr_thread_pool_t me,
apr_interval_time_t  timeout 
)
+
+
+ +

+Access function for the maximum wait time (in microseconds) of an idling thread that exceeds the maximum number of idling threads. A non-zero value allows for the reaping of idling threads to shrink over time. Which helps reduce thrashing.

Parameters:
+ + + +
me The thread pool
timeout The number of microseconds an idle thread should wait till it reaps itself
+
+
Returns:
The original maximum wait time
+ +
+

+ +

+
+ + + + + + + + + +
apr_thread_pool_tasks_high_count (apr_thread_pool_t me  ) 
+
+
+ +

+Get high water mark of the number of tasks waiting to run

Parameters:
+ + +
me The thread pool
+
+
Returns:
High water mark of tasks waiting to run
+ +
+

+ +

+
+ + + + + + + + + +
apr_thread_pool_tasks_run_count (apr_thread_pool_t me  ) 
+
+
+ +

+Get number of tasks that have run

Parameters:
+ + +
me The thread pool
+
+
Returns:
Number of tasks that have run
+ +
+

+ +

+
+ + + + + + + + + +
apr_thread_pool_threads_high_count (apr_thread_pool_t me  ) 
+
+
+ +

+Get high water mark of the number of threads

Parameters:
+ + +
me The thread pool
+
+
Returns:
High water mark of threads in thread pool
+ +
+

+ +

+
+ + + + + + + + + +
apr_thread_pool_threads_idle_timeout_count (apr_thread_pool_t me  ) 
+
+
+ +

+Get the number of idle threads that were destroyed after timing out

Parameters:
+ + +
me The thread pool
+
+
Returns:
Number of idle threads that timed out
+ +
+

+ +

+
+ + + + + + + + + +
APU_DECLARE (apr_size_t   ) 
+
+
+ +

+Get the current number of tasks waiting in the queue

Parameters:
+ + +
me The thread pool
+
+
Returns:
Number of tasks in the queue
+Get the current number of scheduled tasks waiting in the queue
Parameters:
+ + +
me The thread pool
+
+
Returns:
Number of scheduled tasks in the queue
+Get the current number of threads
Parameters:
+ + +
me The thread pool
+
+
Returns:
Total number of threads
+Get the current number of busy threads
Parameters:
+ + +
me The thread pool
+
+
Returns:
Number of busy threads
+Get the current number of idle threads
Parameters:
+ + +
me The thread pool
+
+
Returns:
Number of idle threads
+Access function for the maximum number of idle threads. Number of current idle threads will be reduced to the new limit.
Parameters:
+ + + +
me The thread pool
cnt The number
+
+
Returns:
The number of threads that were stopped.
+Access function for the maximum number of idle threads
Parameters:
+ + +
me The thread pool
+
+
Returns:
The current maximum number
+Access function for the maximum number of threads.
Parameters:
+ + + +
me The thread pool
cnt Number of threads
+
+
Returns:
The original maximum number of threads
+Access function for the maximum number of threads
Parameters:
+ + +
me The thread pool
+
+
Returns:
The current maximum number
+Access function for the threshold of tasks in queue to trigger a new thread.
Parameters:
+ + + +
me The thread pool
cnt The new threshold
+
+
Returns:
The original threshold
+Access function for the threshold of tasks in queue to trigger a new thread.
Parameters:
+ + +
me The thread pool
+
+
Returns:
The current threshold
+ +
+

+ +

+
+ + + + + + + + + +
APU_DECLARE (apr_status_t   ) 
+
+
+ +

+Create a thread pool

Parameters:
+ + + + + +
me The pointer in which to return the newly created apr_thread_pool object, or NULL if thread pool creation fails.
init_threads The number of threads to be created initially, this number will also be used as the initial value for the maximum number of idle threads.
max_threads The maximum number of threads that can be created
pool The pool to use
+
+
Returns:
APR_SUCCESS if the thread pool was created successfully. Otherwise, the error code.
+Destroy the thread pool and stop all the threads
Returns:
APR_SUCCESS if all threads are stopped.
+Schedule a task to the bottom of the tasks of same priority.
Parameters:
+ + + + + + +
me The thread pool
func The task function
param The parameter for the task function
priority The priority of the task.
owner Owner of this task.
+
+
Returns:
APR_SUCCESS if the task had been scheduled successfully
+Schedule a task to be run after a delay
Parameters:
+ + + + + + +
me The thread pool
func The task function
param The parameter for the task function
time Time in microseconds
owner Owner of this task.
+
+
Returns:
APR_SUCCESS if the task had been scheduled successfully
+Schedule a task to the top of the tasks of same priority.
Parameters:
+ + + + + + +
me The thread pool
func The task function
param The parameter for the task function
priority The priority of the task.
owner Owner of this task.
+
+
Returns:
APR_SUCCESS if the task had been scheduled successfully
+Cancel tasks submitted by the owner. If there is any task from the owner that is currently running, the function will spin until the task finished.
Parameters:
+ + + +
me The thread pool
owner Owner of the task
+
+
Returns:
APR_SUCCESS if the task has been cancelled successfully
+
Note:
The task function should not be calling cancel, otherwise the function may get stuck forever. The function assert if it detect such a case.
+Get owner of the task currently been executed by the thread.
Parameters:
+ + + +
thd The thread is executing a task
owner Pointer to receive owner of the task.
+
+
Returns:
APR_SUCCESS if the owner is retrieved successfully
+ +
+

+

+
Generated on Mon Jun 15 09:45:30 2009 for Apache Portable Runtime by  + +doxygen 1.5.8
+ +