Package com.biglybt.core.util
Class ConcurrentHasher
java.lang.Object
com.biglybt.core.util.ConcurrentHasher
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static boolean
protected int
protected final AESemaphore
protected final List<ConcurrentHasherRequest>
protected final AEMonitor
protected final AESemaphore
protected static final ConcurrentHasher
protected final List<SHA1Hasher>
protected final List<MessageDigest>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddRequest
(ByteBuffer buffer, int hash_version, int piece_size, long v2_file_size) add a synchronous request - on return it will have run (or been cancelled)addRequest
(ByteBuffer buffer, int hash_version, int piece_size, long v2_file_size, ConcurrentHasherRequestListener listener, boolean low_priorty) Add an asynchronous request if listener supplied, sync otherwisestatic boolean
static ConcurrentHasher
static void
-
Field Details
-
singleton
-
processor_num
protected int processor_num -
requests
-
v1_hashers
-
v2_hashers
-
request_sem
-
scheduler_sem
-
requests_mon
-
friendly_hashing
private static boolean friendly_hashing
-
-
Constructor Details
-
ConcurrentHasher
protected ConcurrentHasher()
-
-
Method Details
-
getSingleton
-
concurrentHashingAvailable
public static boolean concurrentHashingAvailable() -
addRequest
public ConcurrentHasherRequest addRequest(ByteBuffer buffer, int hash_version, int piece_size, long v2_file_size) add a synchronous request - on return it will have run (or been cancelled) -
addRequest
public ConcurrentHasherRequest addRequest(ByteBuffer buffer, int hash_version, int piece_size, long v2_file_size, ConcurrentHasherRequestListener listener, boolean low_priorty) Add an asynchronous request if listener supplied, sync otherwise- Parameters:
buffer
-priority
-listener
-low_priorty
- low priority checks will cause the "friendly hashing" setting to be taken into account- Returns:
-
main
-