Browse Source

Queue extra work at 2/3 differently depending on whether we're using nonce range or not.

nfactor-troky
Con Kolivas 13 years ago
parent
commit
8766bca4d4
  1. 38
      driver-bitforce.c

38
driver-bitforce.c

@ -425,23 +425,33 @@ static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint6
bitforce->wait_ms = 0; bitforce->wait_ms = 0;
ret = bitforce_send_work(thr, work); ret = bitforce_send_work(thr, work);
/* Initially wait 2/3 of the average cycle time so we can request more if (!bitforce->nonce_range) {
work before full scan is up */ /* Initially wait 2/3 of the average cycle time so we can request more
sleep_time = (2 * bitforce->sleep_ms) / 3; work before full scan is up */
ms_to_timeval(sleep_time, &tdiff); sleep_time = (2 * bitforce->sleep_ms) / 3;
if (!restart_wait(&tdiff)) ms_to_timeval(sleep_time, &tdiff);
return 1; if (!restart_wait(&tdiff))
return 1;
bitforce->wait_ms += sleep_time; bitforce->wait_ms += sleep_time;
queue_request(thr, false); queue_request(thr, false);
/* Now wait athe final 1/3rd; no bitforce should be finished by now */ /* Now wait athe final 1/3rd; no bitforce should be finished by now */
sleep_time = bitforce->sleep_ms - sleep_time; sleep_time = bitforce->sleep_ms - sleep_time;
ms_to_timeval(sleep_time, &tdiff); ms_to_timeval(sleep_time, &tdiff);
if (!restart_wait(&tdiff)) if (!restart_wait(&tdiff))
return 1; return 1;
bitforce->wait_ms += sleep_time; bitforce->wait_ms += sleep_time;
} else {
sleep_time = bitforce->sleep_ms;
ms_to_timeval(sleep_time, &tdiff);
if (!restart_wait(&tdiff))
return 1;
/* queue extra request once more than 2/3 is done */
if (work->blk.nonce > 0xffffffff / 3 * 2)
queue_request(thr, false);
}
if (ret) if (ret)
ret = bitforce_get_result(thr, work); ret = bitforce_get_result(thr, work);

Loading…
Cancel
Save