create framework of scheduler

This commit is contained in:
Rongsong Shen 2025-12-12 17:57:12 +08:00
parent 486b38d679
commit 30824ae5ea
6 changed files with 167 additions and 48 deletions

View file

@ -1,4 +1,33 @@
#if !defined(_SCHEDULER_H_)
#define _SCHEDULER_H_ 1
#include "client.h"
#include "xce/types.h"
#include "xlist.h"
typedef enum {
XCE_DECISION_NONE = 0,
XCE_DECISION_DISPATCH,
XCE_DECISION_PEND
} xce_decision_op_t;
typedef struct {
xce_decision_op_t op;
union {
xce_job_alloc_t *alloc;
} u;
} xce_decision_t;
typedef struct {
xcecli_ctx_t apictx;
xlist_t decisions;
} xce_scheduler_t;
extern int sched_init(xce_scheduler_t*, xce_client_config_t*,
xce_request_handler_t);
extern void sched_fini(xce_scheduler_t*);
extern int sched_update(xce_scheduler_t*);
extern int sched_go(xce_scheduler_t*);
#endif