ROSS
tw-eventq.h File Reference
#include "buddy.h"
#include "hash-quadratic.h"
#include "instrumentation/st-instrumentation.h"
#include "ross-extern.h"
#include "ross-kernel-inline.h"
#include "ross-types.h"

Go to the source code of this file.

Macros

#define ROSS_DEBUG   0
#define CMP_EVENT_TO_GVT(e, pe)

Functions

static void tw_eventq_debug (tw_eventq *q)
static void tw_eventq_push_list (tw_eventq *q, tw_event *h, tw_event *t, long cnt)
static void tw_eventq_fossil_collect (tw_eventq *q, tw_pe *pe)
static void tw_eventq_alloc (tw_eventq *q, unsigned int cnt)
static void tw_eventq_push (tw_eventq *q, tw_event *e)
static tw_eventtw_eventq_peek (tw_eventq *q)
static tw_eventtw_eventq_pop (tw_eventq *q)
static void tw_eventq_unshift (tw_eventq *q, tw_event *e)
static tw_eventtw_eventq_peek_head (tw_eventq *q)
static tw_eventtw_eventq_shift (tw_eventq *q)
static void tw_eventq_delete_any (tw_eventq *q, tw_event *e)
static tw_eventtw_eventq_pop_list (tw_eventq *q)
static void tw_eventq_splice (tw_eventq *q, tw_event *h, tw_event *t, int cnt)

Macro Definition Documentation

◆ CMP_EVENT_TO_GVT

#define CMP_EVENT_TO_GVT ( e,
pe )
Value:
TW_STIME_CMP(e->recv_ts, pe->GVT)
tw_pe * pe
Definition avl_tree.c:10
#define TW_STIME_CMP(x, y)
Definition ross-base.h:43

Definition at line 147 of file tw-eventq.h.

◆ ROSS_DEBUG

#define ROSS_DEBUG   0

Definition at line 11 of file tw-eventq.h.

Function Documentation

◆ tw_eventq_alloc()

void tw_eventq_alloc ( tw_eventq * q,
unsigned int cnt )
inlinestatic

◆ tw_eventq_debug()

void tw_eventq_debug ( tw_eventq * q)
inlinestatic

debug assitant fuction

Definition at line 17 of file tw-eventq.h.

References tw_eventq::head, tw_event::next, tw_event::prev, tw_eventq::size, tw_eventq::tail, tw_error(), and TW_LOC.

◆ tw_eventq_delete_any()

void tw_eventq_delete_any ( tw_eventq * q,
tw_event * e )
inlinestatic

delete an event from anywhere in the list

Definition at line 408 of file tw-eventq.h.

References tw_eventq::head, tw_event::next, tw_event::prev, tw_eventq::size, tw_eventq::tail, and tw_eventq_debug().

◆ tw_eventq_fossil_collect()

void tw_eventq_fossil_collect ( tw_eventq * q,
tw_pe * pe )
inlinestatic

Given a list, move the portion of its contents that is older than GVT to the free list.

Assumptions:

  • The provided q is not the free_q
  • The head of the list has the maximum time stamp in the list. Therefore, if the head is older than GVT, everything in the list is as well.

Definition at line 160 of file tw-eventq.h.

References CMP_EVENT_TO_GVT, tw_eventq::head, tw_event::next, pe, tw_event::prev, tw_eventq::size, tw_eventq::tail, and tw_eventq_push_list().

◆ tw_eventq_peek()

tw_event * tw_eventq_peek ( tw_eventq * q)
inlinestatic

peek to tail of list

Definition at line 304 of file tw-eventq.h.

References tw_eventq::tail.

◆ tw_eventq_peek_head()

tw_event * tw_eventq_peek_head ( tw_eventq * q)
inlinestatic

peek at head of list

Definition at line 368 of file tw-eventq.h.

References tw_eventq::head.

◆ tw_eventq_pop()

tw_event * tw_eventq_pop ( tw_eventq * q)
inlinestatic

pop to tail of list

Definition at line 313 of file tw-eventq.h.

References tw_eventq::head, tw_event::next, tw_event::prev, tw_eventq::size, tw_eventq::tail, and tw_eventq_debug().

◆ tw_eventq_pop_list()

tw_event * tw_eventq_pop_list ( tw_eventq * q)
inlinestatic

pop the entire list. After this operation, the size of the provided q is 0.

Definition at line 436 of file tw-eventq.h.

References tw_eventq::head, tw_eventq::size, and tw_eventq::tail.

◆ tw_eventq_push()

void tw_eventq_push ( tw_eventq * q,
tw_event * e )
inlinestatic

push to tail of list

Definition at line 281 of file tw-eventq.h.

References tw_eventq::head, tw_event::next, tw_event::prev, tw_eventq::size, tw_eventq::tail, and tw_eventq_debug().

◆ tw_eventq_push_list()

◆ tw_eventq_shift()

tw_event * tw_eventq_shift ( tw_eventq * q)
inlinestatic

pop from head of list

Definition at line 377 of file tw-eventq.h.

References tw_eventq::head, tw_event::next, tw_event::prev, tw_eventq::size, tw_eventq::tail, and tw_eventq_debug().

◆ tw_eventq_splice()

void tw_eventq_splice ( tw_eventq * q,
tw_event * h,
tw_event * t,
int cnt )
inlinestatic

The purpose of this function is to be able to remove some part of a list.. could be all of list, from head to some inner buffer, or from some inner buffer to tail. I only care about the last case..

Definition at line 453 of file tw-eventq.h.

References tw_eventq::head, tw_event::next, tw_event::prev, tw_eventq::size, tw_eventq::tail, and tw_eventq_debug().

◆ tw_eventq_unshift()

void tw_eventq_unshift ( tw_eventq * q,
tw_event * e )
inlinestatic

push to head of list

Definition at line 344 of file tw-eventq.h.

References tw_eventq::head, tw_event::next, tw_event::prev, tw_eventq::size, tw_eventq::tail, and tw_eventq_debug().