1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 07:17:58 +00:00

Work items have a tendency to expire at exactly the same time and we don't queue extra items when there are plenty in the queue, regardless of age.

Allow extra work items to be queued if adequate time has passed since we last requested work even if over the limit.
This commit is contained in:
Con Kolivas 2012-02-09 22:27:20 +11:00
parent ffbf15ad82
commit 435e5c85f6

View File

@ -2902,12 +2902,18 @@ static void pool_resus(struct pool *pool)
switch_pools(NULL);
}
static long requested_tv_sec;
static bool queue_request(struct thr_info *thr, bool needed)
{
struct workio_cmd *wc;
int rq = requests_queued();
struct workio_cmd *wc;
struct timeval now;
if (rq >= mining_threads + staged_clones)
gettimeofday(&now, NULL);
if (rq >= mining_threads + staged_clones &&
(now.tv_sec - requested_tv_sec) > opt_scantime * 2 / 3)
return true;
/* fill out work request message */
@ -2939,6 +2945,7 @@ static bool queue_request(struct thr_info *thr, bool needed)
return false;
}
requested_tv_sec = now.tv_sec;
inc_queued();
return true;
}