Add feature: priority

Signed-off-by: Jing Wang <jingwang96@qq.com>
This commit is contained in:
Jing Wang
2026-05-12 11:51:57 +00:00
parent d627a45881
commit b6549b6e38
11 changed files with 382 additions and 66 deletions

View File

@@ -55,7 +55,7 @@ void ShmManager::run_busy_loop() {
while (!stop_loop_flag.load(std::memory_order_acquire)) {
process_requests();
if (loop_cnt % heartbeat_check_everyN== 0) {
if (loop_cnt % heartbeat_check_everyN == 0) {
check_heart_beats();
}
loop_cnt = (loop_cnt + 1) % heartbeat_check_everyN;
@@ -152,6 +152,8 @@ void ShmManager::check_heart_beats() {
shm_helper->heart_beats[i].tgid = 0;
shm_helper->heart_beats[i].timestamp.store(0,
std::memory_order_release);
// clear waiting flag
shm_helper->waiting_worker_flags[i].store(0, std::memory_order_release);
// check dead lock
for (int gpu_id : valid_gpu_ids) {
uint64_t gpu_flag =