Browse Source

Slowly remove work even if it's not being used to keep the getwork counter incrementing even if work is not used and as a test that pools are still working.

port-ckolivas
Con Kolivas 11 years ago committed by Noel Maersk
parent
commit
117c032b92
  1. 12
      sgminer.c

12
sgminer.c

@ -5761,6 +5761,9 @@ static struct work *hash_pop(void) @@ -5761,6 +5761,9 @@ static struct work *hash_pop(void)
/* Signal hash_pop again in case there are mutliple hash_pop waiters */
pthread_cond_signal(&getq->cond);
/* Keep track of last getwork grabbed */
last_getwork = time(NULL);
mutex_unlock(stgd_lock);
return work;
@ -5920,7 +5923,6 @@ struct work *get_work(struct thr_info *thr, const int thr_id) @@ -5920,7 +5923,6 @@ struct work *get_work(struct thr_info *thr, const int thr_id)
wake_gws();
}
}
last_getwork = time(NULL);
applog(LOG_DEBUG, "Got work from get queue to get work for thread %d", thr_id);
work->thr_id = thr_id;
@ -8155,8 +8157,14 @@ begin_bench: @@ -8155,8 +8157,14 @@ begin_bench:
}
mutex_unlock(stgd_lock);
if (ts > max_staged)
if (ts > max_staged) {
/* Keeps slowly generating work even if it's not being
* used to keep last_getwork incrementing and to see
* if pools are still alive. */
work = hash_pop();
discard_work(work);
continue;
}
work = make_work();

Loading…
Cancel
Save