shlomif / fc-solve

Freecell Solver - a C library for automatically solving Freecell and some other variants of card Solitaire
https://fc-solve.shlomifish.org/
MIT License
60 stars 13 forks source link

Convert depth_dbm_solver.c to use condition variables instead of a busy/sleep loop #8

Closed shlomif closed 7 years ago

shlomif commented 7 years ago

Make a wise use of condition variables in the depth_dbm_solver instead of a busy/usleep() loop to wake up threads for further processing. The basic idea is:

  1. A worker thread will signal the condvar when new data is available in the queue to wake up a single thread.

  2. A thread will broadcast the condvar to terminate the process completely.

Please use a feature branch for that.

shlomif commented 7 years ago

Merged into master, so closing.