forked from lei.chen/myxce
save works
This commit is contained in:
parent
f44ad07116
commit
d0174f2f30
7 changed files with 241 additions and 12 deletions
|
|
@ -4,26 +4,46 @@
|
|||
|
||||
#include <pthread.h>
|
||||
|
||||
#include "decision.h"
|
||||
#include "client.h"
|
||||
#include "dataq.h"
|
||||
#include "mylock.h"
|
||||
#include "xce/types.h"
|
||||
#include "xlist.h"
|
||||
|
||||
typedef enum {
|
||||
XCE_DECISION_NONE = 0,
|
||||
XCE_DECISION_DISPATCH,
|
||||
XCE_DECISION_PEND
|
||||
} xce_decision_op_t;
|
||||
XCE_SCHED_OP_NONE = 0,
|
||||
XCE_SCHED_OP_UPDATE_CONFIG,
|
||||
XCE_SCHED_OP_UPDATE_JOB,
|
||||
XCE_SCHED_OP_UPDATE_WORKER
|
||||
} xce_sched_op_t;
|
||||
|
||||
typedef struct {
|
||||
xce_decision_op_t op;
|
||||
data_item_t link;
|
||||
xce_sched_op_t op;
|
||||
union {
|
||||
xce_job_alloc_t* alloc;
|
||||
xce_conf4sched_t* config;
|
||||
struct {
|
||||
int njobs;
|
||||
xce_job_t** jobs;
|
||||
} jobupdate;
|
||||
struct {
|
||||
int nworkers;
|
||||
xce_worker_t** workers;
|
||||
} workerupdate;
|
||||
} u;
|
||||
} xce_decision_t;
|
||||
} xce_sched_update_request_t;
|
||||
|
||||
#define ITPTR_TO_UPDATE_REQ(p) \
|
||||
((xce_sched_update_request_t*)(((char*)p) \
|
||||
- offsetof(xce_sched_update_request_t, \
|
||||
link)))
|
||||
|
||||
typedef struct {
|
||||
mylock_t lock;
|
||||
int stop;
|
||||
xcecli_ctx_t apictx;
|
||||
dataq_t* pend_updates[2];
|
||||
pthread_t jobpicker;
|
||||
pthread_t allocator;
|
||||
cbuf_t wbuf; /* action to trigger scheduling */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue