#include "dnxTimer.h"
#include "dnxServerMain.h"
#include "dnxError.h"
#include "dnxDebug.h"
#include "dnxProtocol.h"
#include "dnxJobList.h"
#include "dnxLogging.h"
#include "dnxSleep.h"
#include "dnxStats.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <assert.h>
Go to the source code of this file.
Data Structures | |
struct | iDnxTimer_ |
DNX job expiration timer implementation structure. More... | |
Defines | |
#define | DNX_DEF_TIMER_SLEEP 5000 |
#define | MAX_EXPIRED 10 |
Typedefs | |
typedef struct iDnxTimer_ | iDnxTimer |
DNX job expiration timer implementation structure. | |
Functions | |
static void | dnxTimerCleanup (void *data) |
Timer thread clean-up routine. | |
static void * | dnxTimer (void *data) |
The main timer thread procedure entry point. | |
int | dnxTimerCreate (DnxJobList *joblist, int sleeptime, DnxTimer **ptimer) |
Create a new job list expiration timer object. | |
void | dnxTimerDestroy (DnxTimer *timer) |
Destroy an existing job list expiration timer object. |
The purpose of this thread is to monitor the age of service requests which are being actively executed by the worker nodes.
This requires access to the global Pending queue (which is also manipulated by the Dispatcher and Collector threads.)
Definition in file dnxTimer.c.
#define DNX_DEF_TIMER_SLEEP 5000 |
Default timer sleep interval.
Definition at line 55 of file dnxTimer.c.
Referenced by dnxTimerCreate().
#define MAX_EXPIRED 10 |
Maximum expired jobs during interval.
Definition at line 56 of file dnxTimer.c.
Referenced by dnxTimer().
typedef struct iDnxTimer_ iDnxTimer |
DNX job expiration timer implementation structure.
static void* dnxTimer | ( | void * | data | ) | [static] |
The main timer thread procedure entry point.
[in] | data | - an opaque pointer to thread data for the timer thread. This is actually the dnx server global data object. |
Definition at line 93 of file dnxTimer.c.
References DnxNodeRequest::address, DnxNewJob::cmd, DNX_MAX_ADDRSTR, DNX_OK, dnxAuditJob(), dnxCancelableSleep(), dnxDebug(), dnxErrorString(), dnxJobCleanup(), dnxJobListExpire(), dnxLog(), dnxPostResult(), dnxStatsInc(), dnxTimerCleanup(), iDnxTimer_::joblist, MAX_EXPIRED, DnxXID::objSerial, DnxXID::objSlot, DnxNewJob::payload, DnxNewJob::pNode, RESULTS_TIMED_OUT, iDnxTimer_::sleepms, DnxNewJob::start_time, and DnxNewJob::xid.
Referenced by dnxTimerCreate().
static void dnxTimerCleanup | ( | void * | data | ) | [static] |
Timer thread clean-up routine.
[in] | data | - an opaque pointer to thread data for the dying thread. |
Definition at line 78 of file dnxTimer.c.
Referenced by dnxTimer().
int dnxTimerCreate | ( | DnxJobList * | joblist, | |
int | sleeptime, | |||
DnxTimer ** | ptimer | |||
) |
Create a new job list expiration timer object.
[in] | joblist | - the job list that should be expired by the timer. |
[in] | sleeptime | - time between expiration checks, in milliseconds. |
[out] | ptimer | - the address of storage for returning the new object reference. |
Definition at line 166 of file dnxTimer.c.
Referenced by dnxJobListCreate().
void dnxTimerDestroy | ( | DnxTimer * | timer | ) |
Destroy an existing job list expiration timer object.
[in] | timer | - the timer object to be destroyed. |
Definition at line 200 of file dnxTimer.c.
Referenced by dnxJobListDestroy().