blah.concurrency.second.DefaultJobDispatcher Maven / Gradle / Ivy
package blah.concurrency.second;
import java.util.concurrent.Executors;
public class DefaultJobDispatcher implements JobDispatcher {
final int availableProcessors = Runtime.getRuntime().availableProcessors();
final java.util.concurrent.ExecutorService executor;
final JobQueue buffer;
public DefaultJobDispatcher( int bufferSize ) {
buffer = new JobQueue(bufferSize);
executor = Executors.newFixedThreadPool( availableProcessors );
initializeJobRunners();
}
void initializeJobRunners(){
for ( int i=0; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy