merged RC_1_1 into master
This commit is contained in:
commit
2cb29f88ac
|
@ -289,6 +289,12 @@ namespace aux {
|
||||||
~disk_io_thread();
|
~disk_io_thread();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
// every 4:th thread is a hash thread
|
||||||
|
hasher_thread_divisor = 4
|
||||||
|
};
|
||||||
|
|
||||||
void set_settings(settings_pack const* sett);
|
void set_settings(settings_pack const* sett);
|
||||||
|
|
||||||
void abort(bool wait);
|
void abort(bool wait);
|
||||||
|
|
|
@ -321,7 +321,7 @@ constexpr disk_job_flags_t disk_interface::cache_hit;
|
||||||
|
|
||||||
int const num_threads = m_settings.get_int(settings_pack::aio_threads);
|
int const num_threads = m_settings.get_int(settings_pack::aio_threads);
|
||||||
// add one hasher thread for every three generic threads
|
// add one hasher thread for every three generic threads
|
||||||
int const num_hash_threads = num_threads / 4;
|
int const num_hash_threads = num_threads / hasher_thread_divisor;
|
||||||
m_generic_threads.set_max_threads(num_threads - num_hash_threads);
|
m_generic_threads.set_max_threads(num_threads - num_hash_threads);
|
||||||
m_hash_threads.set_max_threads(num_hash_threads);
|
m_hash_threads.set_max_threads(num_hash_threads);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2291,8 +2291,11 @@ bool is_downloading_state(int const st)
|
||||||
/ m_torrent_file->piece_length();
|
/ m_torrent_file->piece_length();
|
||||||
// if we only keep a single read operation in-flight at a time, we suffer
|
// if we only keep a single read operation in-flight at a time, we suffer
|
||||||
// significant performance degradation. Always keep at least two jobs
|
// significant performance degradation. Always keep at least two jobs
|
||||||
// outstanding
|
// outstanding per hasher thread
|
||||||
if (num_outstanding < 2) num_outstanding = 2;
|
int const min_outstanding = 2
|
||||||
|
* std::max(1, settings().get_int(settings_pack::aio_threads)
|
||||||
|
/ disk_io_thread::hasher_thread_divisor);
|
||||||
|
if (num_outstanding < min_outstanding) num_outstanding = min_outstanding;
|
||||||
|
|
||||||
// we might already have some outstanding jobs, if we were paused and
|
// we might already have some outstanding jobs, if we were paused and
|
||||||
// resumed quickly, before the outstanding jobs completed
|
// resumed quickly, before the outstanding jobs completed
|
||||||
|
|
Loading…
Reference in New Issue