1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-23 13:04:29 +00:00

We can queue all the necessary work without hitting frequent stales now with the time and string stale protection active all the time.

This prevents a pool being falsely labelled as not providing work fast enough.
This commit is contained in:
Con Kolivas 2011-08-25 10:21:49 +10:00
parent 81aedc972a
commit a4ec961ecc

18
main.c
View File

@ -2935,19 +2935,11 @@ static bool queue_request(struct thr_info *thr, bool needed)
{
int maxq = opt_queue + mining_threads;
struct workio_cmd *wc;
int rq, rs;
int rq = requests_queued();
rq = requests_queued();
rs = requests_staged();
/* If we've been generating lots of local work we may already have
* enough in the queue */
if (rq >= maxq || rs >= maxq)
if (rq >= maxq)
return true;
if (rs > rq)
goto out;
/* fill out work request message */
wc = calloc(1, sizeof(*wc));
if (unlikely(!wc)) {
@ -2964,7 +2956,7 @@ static bool queue_request(struct thr_info *thr, bool needed)
/* If we're queueing work faster than we can stage it, consider the
* system lagging and allow work to be gathered from another pool if
* possible */
if (!rs && rq && needed)
if (rq && needed && !requests_staged())
wc->lagging = true;
if (opt_debug)
@ -2976,7 +2968,7 @@ static bool queue_request(struct thr_info *thr, bool needed)
workio_cmd_free(wc);
return false;
}
out:
inc_queued();
return true;
}
@ -3093,7 +3085,7 @@ retry:
ret = true;
goto out;
}
if (requested && requests_queued() > 1 && !pool_tset(pool, &pool->lagging)) {
if (requested && !pool_tset(pool, &pool->lagging)) {
applog(LOG_WARNING, "Pool %d not providing work fast enough",
pool->pool_no);
pool->localgen_occasions++;