1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 15:27:53 +00:00

Implement pool rotation strategy.

This commit is contained in:
Con Kolivas 2011-07-20 13:48:23 +10:00
parent 521025aa75
commit fa9e03f487

7
main.c
View File

@ -2384,11 +2384,13 @@ static bool active_device(int thr_id)
static void *watchdog_thread(void *userdata)
{
const unsigned int interval = opt_log_interval / 2 ? : 1;
static struct timeval rotate_tv;
struct timeval zero_tv;
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
memset(&zero_tv, 0, sizeof(struct timeval));
gettimeofday(&rotate_tv, NULL);
while (1) {
int x, y, logx, logy, i;
@ -2435,6 +2437,11 @@ static void *watchdog_thread(void *userdata)
}
}
if (pool_strategy == POOL_ROTATE && now.tv_sec - rotate_tv.tv_sec > 60 * opt_rotate_period) {
gettimeofday(&rotate_tv, NULL);
switch_pools();
}
//for (i = 0; i < mining_threads; i++) {
for (i = 0; i < gpu_threads; i++) {
struct thr_info *thr = &thr_info[i];