1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-09 21:40:33 +02:00

* futures.c (mark_futures): Don't need to mark data of recycled

futures.
(scan_futures, cleanup_undead): Be smarter about marking
futures---avoid unnecessary passes through future lists.
This commit is contained in:
Mikael Djurfeldt 2003-01-23 20:31:38 +00:00
parent 6b468ba449
commit 361d631fb7
2 changed files with 9 additions and 3 deletions

View file

@ -1,5 +1,10 @@
2003-01-23 Mikael Djurfeldt <djurfeldt@nada.kth.se> 2003-01-23 Mikael Djurfeldt <djurfeldt@nada.kth.se>
* futures.c (mark_futures): Don't need to mark data of recycled
futures.
(scan_futures, cleanup_undead): Be smarter about marking
futures---avoid unnecessary passes through future lists.
* futures.h, futures.c: New files; Introduced recycling of * futures.h, futures.c: New files; Introduced recycling of
futures. For fine-grained threading this lifts performance to futures. For fine-grained threading this lifts performance to
another level. We can now use parallelization in inner loops of another level. We can now use parallelization in inner loops of

View file

@ -290,6 +290,7 @@ cleanup_undead ()
scm_cond_signal (SCM_FUTURE_COND (next)); scm_cond_signal (SCM_FUTURE_COND (next));
scm_mutex_unlock (SCM_FUTURE_MUTEX (next)); scm_mutex_unlock (SCM_FUTURE_MUTEX (next));
next: next:
SCM_SET_GC_MARK (next);
nextloc = SCM_FUTURE_NEXTLOC (next); nextloc = SCM_FUTURE_NEXTLOC (next);
next = *nextloc; next = *nextloc;
} }
@ -309,7 +310,6 @@ mark_futures (SCM futures)
{ {
while (!SCM_NULLP (futures)) while (!SCM_NULLP (futures))
{ {
scm_gc_mark (SCM_FUTURE_DATA (futures));
SCM_SET_GC_MARK (futures); SCM_SET_GC_MARK (futures);
futures = SCM_FUTURE_NEXT (futures); futures = SCM_FUTURE_NEXT (futures);
} }
@ -329,6 +329,8 @@ scan_futures (void *dummy1, void *dummy2, void *dummy3)
young = SCM_EOL; young = SCM_EOL;
last_switch = now; last_switch = now;
} }
else
mark_futures (young);
next = futures; next = futures;
nextloc = &futures; nextloc = &futures;
@ -352,15 +354,14 @@ scan_futures (void *dummy1, void *dummy2, void *dummy3)
{ {
SCM future; SCM future;
UNLINK (next, future); UNLINK (next, future);
SCM_SET_GC_MARK (future);
LINK (young, future); LINK (young, future);
} }
} }
*nextloc = SCM_EOL; *nextloc = SCM_EOL;
exit: exit:
cleanup_undead (); cleanup_undead ();
mark_futures (young);
mark_futures (old); mark_futures (old);
mark_futures (undead);
return 0; return 0;
} }