|
Dynamic Load Balance 3.6.1+32-59d1
|
#include "support/queues.h"#include "support/debug.h"#include "apis/dlb_errors.h"#include <string.h>
Data Structures | |
| struct | queue_t |
| struct | queue_iter_t |
Enumerations | |
| enum | { NOBODY = 0 } |
Functions | |
| void | queue_lewi_reqs_init (queue_lewi_reqs_t *queue) |
| unsigned int | queue_lewi_reqs_size (const queue_lewi_reqs_t *queue) |
| unsigned int | queue_lewi_reqs_remove (queue_lewi_reqs_t *queue, pid_t pid) |
| int | queue_lewi_reqs_push (queue_lewi_reqs_t *queue, pid_t pid, unsigned int howmany) |
| unsigned int | queue_lewi_reqs_pop_ncpus (queue_lewi_reqs_t *queue, unsigned int ncpus, lewi_request_t *requests, unsigned int *nreqs, unsigned int maxreqs) |
| unsigned int | queue_lewi_reqs_get (queue_lewi_reqs_t *queue, pid_t pid) |
| void | queue_proc_reqs_init (queue_proc_reqs_t *queue) |
| unsigned int | queue_proc_reqs_size (const queue_proc_reqs_t *queue) |
| process_request_t * | queue_proc_reqs_front (queue_proc_reqs_t *queue) |
| process_request_t * | queue_proc_reqs_back (queue_proc_reqs_t *queue) |
| void | queue_proc_reqs_remove (queue_proc_reqs_t *queue, pid_t pid) |
| int | queue_proc_reqs_push (queue_proc_reqs_t *queue, pid_t pid, unsigned int howmany, const cpu_set_t *allowed) |
| void | queue_proc_reqs_pop (queue_proc_reqs_t *queue, process_request_t *request) |
| void | queue_proc_reqs_get (queue_proc_reqs_t *queue, pid_t *pid, int cpuid) |
| void | queue_pids_init (queue_pids_t *queue) |
| unsigned int | queue_pids_size (const queue_pids_t *queue) |
| void | queue_pids_remove (queue_pids_t *queue, pid_t pid) |
| int | queue_pids_push (queue_pids_t *queue, pid_t pid) |
| void | queue_pids_pop (queue_pids_t *queue, pid_t *pid) |
| queue_t * | queue__init (size_t element_size, unsigned int capacity, void *ptr, queue_allocator_t allocator) |
| void | queue__destroy (queue_t *queue) |
| unsigned int | queue__get_size (const queue_t *queue) |
| unsigned int | queue__get_capacity (const queue_t *queue) |
| bool | queue__is_empty (const queue_t *queue) |
| bool | queue__is_at_capacity (const queue_t *queue) |
| int | queue__take_head (queue_t *queue, void *poped) |
| int | queue__take_tail (queue_t *queue, void *poped) |
| int | queue__peek_head (queue_t *queue, void **value_ptr) |
| int | queue__peek_tail (queue_t *queue, void **value_ptr) |
| void * | queue__push_head (queue_t *queue, const void *new) |
| void * | queue__push_tail (queue_t *queue, const void *new) |
| void | queue_iter__foreach (void *iter, void(*fn)(void *, void *), void *args) |
| void * | queue_iter__get_nth (void *iter, unsigned int n) |
| queue_iter_head2tail_t | queue__into_head2tail_iter (queue_t *queue) |
| void queue_lewi_reqs_init | ( | queue_lewi_reqs_t * | queue | ) |
| unsigned int queue_lewi_reqs_size | ( | const queue_lewi_reqs_t * | queue | ) |
| unsigned int queue_lewi_reqs_remove | ( | queue_lewi_reqs_t * | queue, |
| pid_t | pid | ||
| ) |
| int queue_lewi_reqs_push | ( | queue_lewi_reqs_t * | queue, |
| pid_t | pid, | ||
| unsigned int | howmany | ||
| ) |
| unsigned int queue_lewi_reqs_pop_ncpus | ( | queue_lewi_reqs_t * | queue, |
| unsigned int | ncpus, | ||
| lewi_request_t * | requests, | ||
| unsigned int * | nreqs, | ||
| unsigned int | maxreqs | ||
| ) |
| unsigned int queue_lewi_reqs_get | ( | queue_lewi_reqs_t * | queue, |
| pid_t | pid | ||
| ) |
| void queue_proc_reqs_init | ( | queue_proc_reqs_t * | queue | ) |
| unsigned int queue_proc_reqs_size | ( | const queue_proc_reqs_t * | queue | ) |
| process_request_t * queue_proc_reqs_front | ( | queue_proc_reqs_t * | queue | ) |
| process_request_t * queue_proc_reqs_back | ( | queue_proc_reqs_t * | queue | ) |
| void queue_proc_reqs_remove | ( | queue_proc_reqs_t * | queue, |
| pid_t | pid | ||
| ) |
| int queue_proc_reqs_push | ( | queue_proc_reqs_t * | queue, |
| pid_t | pid, | ||
| unsigned int | howmany, | ||
| const cpu_set_t * | allowed | ||
| ) |
| void queue_proc_reqs_pop | ( | queue_proc_reqs_t * | queue, |
| process_request_t * | request | ||
| ) |
| void queue_proc_reqs_get | ( | queue_proc_reqs_t * | queue, |
| pid_t * | pid, | ||
| int | cpuid | ||
| ) |
| void queue_pids_init | ( | queue_pids_t * | queue | ) |
| unsigned int queue_pids_size | ( | const queue_pids_t * | queue | ) |
| void queue_pids_remove | ( | queue_pids_t * | queue, |
| pid_t | pid | ||
| ) |
| int queue_pids_push | ( | queue_pids_t * | queue, |
| pid_t | pid | ||
| ) |
| void queue_pids_pop | ( | queue_pids_t * | queue, |
| pid_t * | pid | ||
| ) |
| queue_t * queue__init | ( | size_t | element_size, |
| unsigned int | capacity, | ||
| void * | ptr, | ||
| queue_allocator_t | allocator | ||
| ) |
Initializes a queue with a pre-allocated storage.
Notes:
Returns NULL if it fails.
| void queue__destroy | ( | queue_t * | queue | ) |
Destroys a queue and frees the storage.
| unsigned int queue__get_size | ( | const queue_t * | queue | ) |
Returns the number of elements avaliable in the queue.
| unsigned int queue__get_capacity | ( | const queue_t * | queue | ) |
Returns the maximum number of elements the queue can fit.
| bool queue__is_empty | ( | const queue_t * | queue | ) |
Returns true if the queue does not contain any element.
| bool queue__is_at_capacity | ( | const queue_t * | queue | ) |
Returns true if the number of elements is equal to the capacity of the queue.
When the queue is at capacity it means that if more data is puhsed to the queue without removing this action will cause an error, overwrite a value from the other end, or reallocate the storage (depending on the choosen allocation policy).
| int queue__take_head | ( | queue_t * | queue, |
| void * | value | ||
| ) |
Takes the head off of the queue and places it to poped.
Returns DLB_NOUPDT if the queue is empty, and DLB_SUCCESS otherwise.
| int queue__take_tail | ( | queue_t * | queue, |
| void * | value | ||
| ) |
Takes the tail off of the queue and places it to poped.
Returns DLB_NOUPDT if the queue is empty, and DLB_SUCCESS otherwise.
| int queue__peek_head | ( | queue_t * | queue, |
| void ** | value_ptr | ||
| ) |
Peek the head and return its value without removing it from the queue.
Returns DLB_NOUPDT if the queue is empty, and DLB_SUCCESS otherwise.
| int queue__peek_tail | ( | queue_t * | queue, |
| void ** | value_ptr | ||
| ) |
Peek the tail and return its value without removing it from the queue.
Returns DLB_NOUPDT if the queue is empty, and DLB_SUCCESS otherwise.
| void * queue__push_head | ( | queue_t * | queue, |
| const void * | new | ||
| ) |
Pushes the new value to the queue on the head, and overwrites the tail if the queue was at capacity.
Returns NULL if the push fails.
| void * queue__push_tail | ( | queue_t * | queue, |
| const void * | new | ||
| ) |
Pushes the new value to the queue on the head, and overwrites the tail if the queue was at capacity.
Returns NULL if the push fails.
| void queue_iter__foreach | ( | void * | iter, |
| void(*)(void *, void *) | fn, | ||
| void * | args | ||
| ) |
Executes the fn function for all the values of iter as it is iterated by its specific implementation.
| void * queue_iter__get_nth | ( | void * | iter, |
| unsigned int | n | ||
| ) |
Returns a pointer to the nth element in the iterator.
Returns NULL if not enough elements are avaliable.
| queue_iter_head2tail_t queue__into_head2tail_iter | ( | queue_t * | queue | ) |
Creates a queue_iter_head2tail_t iterator from a queue_t.