public class ProcessorSettings
extends java.lang.Object
ProcessorSettings allow to recognize barcodes with multi-threaded increasing of performance
This sample shows how to use ProcessorSettings to add maximum multi-threaded performnceBarCodeReader.getProcessorSettings().setMaxAdditionalAllowedThreads(Environment.getProcessorCount()* 2); //this allows to use all cores for single BarCodeReader call BarCodeReader.getProcessorSettings().setUseAllCores(true); //this allows to use current count of cores BarCodeReader.getProcessorSettings().setUseAllCores(false); BarCodeReader.getProcessorSettings().setUseOnlyThisCoresCount(Math.max(1, Environment.getProcessorCount() / 2));
Modifier and Type | Method and Description |
---|---|
int |
getMaxAdditionalAllowedThreads()
Specify the maximal number of additional threads to run code in parallel
|
boolean |
getUseAllCores()
Is needed to use all cores.
|
int |
getUseOnlyThisCoresCount()
Specify the number of cores to use.
|
void |
setMaxAdditionalAllowedThreads(int value)
Specify the maximal number of additional threads to run code in parallel
|
void |
setUseAllCores(boolean value)
Is needed to use all cores.
|
void |
setUseOnlyThisCoresCount(int value)
Specify the number of cores to use.
|
public boolean getUseAllCores()
Is needed to use all cores.
BarCodeReader.getProcessorSettings().setUseAllCores(true);
public void setUseAllCores(boolean value)
Is needed to use all cores.
BarCodeReader.getProcessorSettings().setUseAllCores(true);
public int getUseOnlyThisCoresCount()
Specify the number of cores to use. You need to change the property "UseAllCores" to "false".
BarCodeReader.getProcessorSettings().setUseAllCores(false); BarCodeReader.getProcessorSettings().setUseOnlyThisCoresCount(Math.max(1, Environment.getProcessorCount() / 2));
public void setUseOnlyThisCoresCount(int value)
Specify the number of cores to use. You need to change the property "UseAllCores" to "false".
BarCodeReader.getProcessorSettings().setUseAllCores(false); BarCodeReader.getProcessorSettings().setUseOnlyThisCoresCount(Math.max(1, Environment.getProcessorCount() / 2));
public int getMaxAdditionalAllowedThreads()
Specify the maximal number of additional threads to run code in parallel
BarCodeReader.getProcessorSettings().setMaxAdditionalAllowedThreads(Environment.getProcessorCount() * 2);
public void setMaxAdditionalAllowedThreads(int value)
Specify the maximal number of additional threads to run code in parallel
BarCodeReader.getProcessorSettings().setMaxAdditionalAllowedThreads(Environment.getProcessorCount() * 2);