/** * Create a striped counters object using <code>numProcessors*2</code> * stripes and the specified <i>batchSize</i>. * * @param batchSize * The values on the instance stripes will be published to the * outer instance every batchSize {@link #release()}s. */ public StripedCounters(final int batchSize) { this(SystemUtil.numProcessors() * 2, batchSize); }
/** * Create a striped counters object using <code>numProcessors*2</code> * stripes and the specified <i>batchSize</i>. * * @param batchSize * The values on the instance stripes will be published to the * outer instance every batchSize {@link #release()}s. */ public StripedCounters(final int batchSize) { this(SystemUtil.numProcessors() * 2, batchSize); }
public BigdataTriplePatternMaterializer(final AbstractTripleStore db, final IChunkedOrderedIterator<BigdataTriplePattern> src, final int nthreads) { super(db, src, new BlockingBuffer<ISPO[]>( db.getChunkOfChunksCapacity(), db.getChunkCapacity(), db.getChunkTimeout(), TimeUnit.MILLISECONDS)); if (nthreads < 0) throw new IllegalArgumentException(); // At least 1 thread. At most ncpus*2. this.nthreads = Math.max( Math.min(nthreads, SystemUtil.numProcessors() * 2), 1); }
public BigdataTriplePatternMaterializer(final AbstractTripleStore db, final IChunkedOrderedIterator<BigdataTriplePattern> src, final int nthreads) { super(db, src, new BlockingBuffer<ISPO[]>( db.getChunkOfChunksCapacity(), db.getChunkCapacity(), db.getChunkTimeout(), TimeUnit.MILLISECONDS)); if (nthreads < 0) throw new IllegalArgumentException(); // At least 1 thread. At most ncpus*2. this.nthreads = Math.max( Math.min(nthreads, SystemUtil.numProcessors() * 2), 1); }
props.setProperty("os.arch.cpus", ""+SystemUtil.numProcessors());
public void testSystemUtil() { System.out.println( "Number of Processors: " + SystemUtil.numProcessors() ); System.out.println( "CPU Info: " + SystemUtil.cpuInfo() ); System.out.println( "Architecture: " + SystemUtil.architecture() ); System.out.println( "Operating System: " + SystemUtil.operatingSystem() ); System.out.println( "OS Version: " + SystemUtil.osVersion() ); assertEquals( SystemUtil.architecture(), System.getProperty( "os.arch" ) ); assertEquals( SystemUtil.operatingSystem(), System.getProperty( "os.name" ) ); assertEquals( SystemUtil.osVersion(), System.getProperty( "os.version" ) ); } }
new OneShotInstrument<Integer>(SystemUtil.numProcessors()));
new OneShotInstrument<Integer>(SystemUtil.numProcessors()));