Class ConcurrentHasher
java.lang.Object
com.biglybt.core.util.ConcurrentHasher
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static booleanprotected intprotected final AESemaphoreprotected final List<ConcurrentHasherRequest> protected final AEMonitorprotected final AESemaphoreprotected static final ConcurrentHasherprotected 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 booleanstatic ConcurrentHasherstatic 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-listener-low_priorty- low priority checks will cause the "friendly hashing" setting to be taken into accountpriority-- Returns:
-
main
-