diff options
| author | Aargh Rai <aargh.rai+git@gmail.com> | 2026-08-27 22:21:14 +0530 |
|---|---|---|
| committer | Aargh Rai <aargh.rai+git@gmail.com> | 2026-08-27 22:21:14 +0530 |
| commit | 93f1e82cedbf2fcd45ac413cbf2a654e0f65f0b3 (patch) | |
| tree | 5af71701d99071adf348735518b8dd1f560c3475 /src/engine | |
| parent | 5a02743c0c9563f41a8c3821a7bbce4fc3b0b839 (diff) | |
Diffstat (limited to 'src/engine')
| -rw-r--r-- | src/engine/thread.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/src/engine/thread.c b/src/engine/thread.c index 1bb9a83..bbf2605 100644 --- a/src/engine/thread.c +++ b/src/engine/thread.c @@ -70,13 +70,10 @@ void *child_thread(void *_args) { // nothing active right now: idle until the root publishes the next // iteration's block or the search is stopped if (sp == NULL) { - static _Thread_local int spins = 0; - if (++spins == 5000000) fprintf(stderr, "CHILD %d STUCK stop=%d (ptr=%p)\n", args->id, atomic_load(&args->stop), (void*)&args->stop); sched_yield(); continue; } - fprintf(stderr,"CHILD %d found sp\n",args->id); // register as a worker at this block so Merge knows the headcount atomic_fetch_add(&sp->workers, 1); @@ -174,7 +171,6 @@ void *root_thread(void *_args) { ? __pool_alloc(args->split_points, args->sp_pool_capacity) : NULL; - fprintf(stderr,"ROOT iter %d sp=%p\n",depth,(void*)sp); if (sp != NULL) { // Split (ยง2.4): snapshot the root node and hand the whole move list to // the pool; the root works the list alongside its workers. @@ -221,16 +217,9 @@ void *root_thread(void *_args) { if (split_point_merge(sp)) { atomic_store(&sp->state, SPLITPOINT_STATE_FREE); } - fprintf(stderr,"ROOT iter %d waiting w=%d\n",depth,atomic_load(&sp->workers)); - int spins=0; while (atomic_load(&sp->state) == SPLITPOINT_STATE_ACTIVE) { sched_yield(); - if (++spins==1000000) fprintf(stderr,"ROOT STUCK iter %d w=%d idx=%d\n",depth,atomic_load(&sp->workers),atomic_load(&sp->next_move_idx)); } - while (atomic_load(&sp->state) == SPLITPOINT_STATE_ACTIVE) { - sched_yield(); - } - fprintf(stderr,"ROOT iter %d done\n",depth); result.score = atomic_load(&sp->best_score); result.best_move = sp->best_move; |
