mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-02 18:14:20 +00:00
Fix the extra work queued every longpoll by queueing it all in the beginning.
This commit is contained in:
parent
719deb3aac
commit
e99069808a
15
main.c
15
main.c
@ -1218,17 +1218,8 @@ static void restart_threads(void)
|
|||||||
/* Discard old queued requests and get new ones */
|
/* Discard old queued requests and get new ones */
|
||||||
flush_requests();
|
flush_requests();
|
||||||
|
|
||||||
/* Queue extra requests for each worker thread since they'll all need
|
for (i = 0; i < opt_n_threads + gpu_threads; i++)
|
||||||
* new work. Each worker will set their "requested" flag to true
|
|
||||||
* should they receive a .restart */
|
|
||||||
for (i = 0; i < opt_n_threads + gpu_threads; i++) {
|
|
||||||
if (unlikely(!queue_request())) {
|
|
||||||
applog(LOG_ERR, "Failed to queue requests in flush_requests");
|
|
||||||
kill_work();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
work_restart[i].restart = 1;
|
work_restart[i].restart = 1;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *longpoll_thread(void *userdata)
|
static void *longpoll_thread(void *userdata)
|
||||||
@ -1662,8 +1653,8 @@ int main (int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Put the extra work in the queue */
|
/* Put enough work in the queue */
|
||||||
for (i = 0; i < opt_queue; i++) {
|
for (i = 0; i < opt_queue + opt_n_threads + gpu_threads; i++) {
|
||||||
if (unlikely(!queue_request())) {
|
if (unlikely(!queue_request())) {
|
||||||
applog(LOG_ERR, "Failed to queue_request in main");
|
applog(LOG_ERR, "Failed to queue_request in main");
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user