summaryrefslogtreecommitdiff
path: root/src/engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/thread.c11
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;