mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-25 22:14:36 +00:00
Implement pool rotation strategy.
This commit is contained in:
parent
521025aa75
commit
fa9e03f487
7
main.c
7
main.c
@ -2384,11 +2384,13 @@ static bool active_device(int thr_id)
|
|||||||
static void *watchdog_thread(void *userdata)
|
static void *watchdog_thread(void *userdata)
|
||||||
{
|
{
|
||||||
const unsigned int interval = opt_log_interval / 2 ? : 1;
|
const unsigned int interval = opt_log_interval / 2 ? : 1;
|
||||||
|
static struct timeval rotate_tv;
|
||||||
struct timeval zero_tv;
|
struct timeval zero_tv;
|
||||||
|
|
||||||
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
|
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
|
||||||
|
|
||||||
memset(&zero_tv, 0, sizeof(struct timeval));
|
memset(&zero_tv, 0, sizeof(struct timeval));
|
||||||
|
gettimeofday(&rotate_tv, NULL);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
int x, y, logx, logy, i;
|
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 < mining_threads; i++) {
|
||||||
for (i = 0; i < gpu_threads; i++) {
|
for (i = 0; i < gpu_threads; i++) {
|
||||||
struct thr_info *thr = &thr_info[i];
|
struct thr_info *thr = &thr_info[i];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user