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. 10
      driver-bitforce.c

10
driver-bitforce.c

@ -425,6 +425,7 @@ 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);
if (!bitforce->nonce_range) {
/* Initially wait 2/3 of the average cycle time so we can request more /* Initially wait 2/3 of the average cycle time so we can request more
work before full scan is up */ work before full scan is up */
sleep_time = (2 * bitforce->sleep_ms) / 3; sleep_time = (2 * bitforce->sleep_ms) / 3;
@ -442,6 +443,15 @@ static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint6
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