scheduler framework

This commit is contained in:
Rongsong Shen 2025-12-16 16:08:20 +08:00
parent cb0c7fe9e7
commit c478ea8516
3 changed files with 137 additions and 41 deletions

View file

@ -2,6 +2,8 @@
#define _SCHEDULER_H_ 1
#include <pthread.h>
#include "client.h"
#include "xce/types.h"
#include "xlist.h"
@ -21,13 +23,17 @@ typedef struct {
typedef struct {
xcecli_ctx_t apictx;
xlist_t decisions;
pthread_t jobpicker;
pthread_t allocator;
cbuf_t wbuf; /* action to trigger scheduling */
cbuf_t jbuf; /* job picked for allocation */
cbuf_t decisions; /* scheduler 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*);
extern void sched_go(xce_scheduler_t*);
#endif