#ifndef SHARED_H #define SHARED_H #include #define MAX_JOBS 100 #define MAX_PATH 256 #define MAX_NODES 4 #define SHM_NAME "/job_queue_shm" #define SHM_NODE_STATUS "/node_status_shm" typedef struct { pthread_mutex_t mutex; char jobs[MAX_JOBS][MAX_PATH]; int head; int tail; } JobQueue; typedef struct { int node_id; int running_jobs; float load; // from /proc/[pid]/stat or getloadavg() } NodeStatus; typedef struct { pthread_mutex_t mutex; NodeStatus statuses[MAX_NODES]; } NodeStatusArray; #endif