public void runProcessor( TRTrackerServerProcessorTCP processor ) { thread_pool.run( processor ); }
public TRTrackerServerTCP( String _name, int _port, boolean _ssl, boolean _apply_ip_filter, boolean _start_up_ready ) throws TRTrackerServerException { super( _name, _start_up_ready ); port = _port; ssl = _ssl; apply_ip_filter = _apply_ip_filter; thread_pool = new ThreadPool( "TrackerServer:TCP:"+port, THREAD_POOL_SIZE ); if ( PROCESSING_GET_LIMIT > 0 ){ thread_pool.setExecutionLimit( PROCESSING_GET_LIMIT ); } }
@Override public void perform(TimerEvent event) { checkAllTimeouts(); } });
/** * Disables DNS Handling, but doesn't save it to the config */ public static void temporarilyDisableDNSHandling() { DNS_HANDLING_ENABLE = false; dns_threads.setExecutionLimit(10); dns_threads.checkTimeouts(); }
ThreadPool tp = new ThreadPool( "Magnet Recovery", 16, true ); tp.run( new AERunnable()
protected void runScrapes( final ArrayList<TRTrackerScraperResponseImpl> responses, final boolean force, boolean async) { numActiveScrapes.incrementAndGet(); if ( async ){ thread_pool.run( new AERunnable() { @Override public void runSupport() { runScrapesSupport( responses, force ); } }); if (Logger.isEnabled()) { Logger.log(new LogEvent(LOGID, "TrackerStatus: queuing '" + scrapeURL + "', for " + responses.size() + " of " + hashes.size() + " hashes" + ", single_hash_scrapes: " + (bSingleHashScrapes ? "Y" : "N") + ", queue size=" + thread_pool.getQueueSize())); } }else{ runScrapesSupport( responses, force ); } }
public String getName() { return( thread_pool.getName()); }
public NatPMPUPnPRootDeviceImpl( UPnP _upnp, NatPMPDevice _nat_device ) throws Exception { upnp = _upnp; nat_device = _nat_device; location = new URL( "http://undefined/" ); device = new NatPMPUPnPDevice(); services = new UPnPService[]{ new NatPMPUPnPWANConnection() }; thread_pool = new ThreadPool( "NatPMPUPnP", 1, true ); }
checkWarning(); task.taskStarted(); runIt( runnable ); runIt( runnable ); checkWarning();
private static final DiskManagerAllocationScheduler allocation_scheduler = new DiskManagerAllocationScheduler(); private static final ThreadPool start_pool = new ThreadPool( "DiskManager:start", 64, true ); start_pool.setThreadPriority( Thread.MIN_PRIORITY );
@Override public boolean isQueued() { return( tp.isQueued( task )); }
protected static void checkAllTimeouts() { List pools; // copy the busy pools to avoid potential deadlock due to synchronization // nestings synchronized( busy_pools ){ pools = new ArrayList( busy_pools ); } for (int i=0;i<pools.size();i++){ ((ThreadPool)pools.get(i)).checkTimeouts(); } }
public final synchronized void releaseToPool() { // releasing before the initial run finished, so just let the runner do the cleanup if(manualRelease == RELEASE_MANUAL) manualRelease = RELEASE_AUTO; else if(manualRelease == RELEASE_MANUAL_ALLOWED) { taskCompleted(); worker.getOwner().releaseManual(this); manualRelease = RELEASE_AUTO; } else if(manualRelease == RELEASE_AUTO) Debug.out("this should not happen"); notifyAll(); } }
ThreadPool tp = new ThreadPool("Trigger CoreRunning Listeners", 3); for (final CoreRunningListener l : runningListeners) { try { tp.run(new AERunnable() { @Override public void runSupport() {
if ( thread_pool.getQueueSize() >= MAX_QUEUE_SIZE ){ thread_pool.run( new AERunnable()
public synchronized void dump() { System.out.println( "Timer '" + thread_pool.getName() + "': dump" ); Iterator it = events.iterator(); while(it.hasNext()){ TimerEvent ev = (TimerEvent)it.next(); System.out.println( "\t" + ev.getString()); } }
public Timer( String name, int thread_pool_size, int thread_priority ) { if (DEBUG_TIMERS) { try { timers_mon.enter(); if (timers == null) { timers = new ArrayList<>(); AEDiagnostics.addEvidenceGenerator(new evidenceGenerator()); } timers.add(new WeakReference<>(this)); } finally { timers_mon.exit(); } } thread_pool = new ThreadPool(name,thread_pool_size); SystemTime.registerClockChangeListener( this ); Thread t = new Thread(this, "Timer:" + name ); t.setDaemon( true ); t.setPriority(thread_priority); t.start(); }
public threadPoolWorker run(AERunnable runnable) { return( run(runnable, false, false)); }
logger ); internal_lookup_pool = new ThreadPool("DHTControl:internallookups", lookup_concurrency ); internal_put_pool = new ThreadPool("DHTControl:internalputs", lookup_concurrency ); external_lookup_pool = new ThreadPool("DHTControl:externallookups", EXTERNAL_LOOKUP_CONCURRENCY, true ); external_put_pool = new ThreadPool("DHTControl:puts", EXTERNAL_PUT_CONCURRENCY, true ); internal_lookup_pool = new ThreadPool("DHTControl:internallookups", lookup_concurrency ); internal_put_pool = new ThreadPool("DHTControl:internalputs", lookup_concurrency ); external_lookup_pool = new ThreadPool("DHTControl:externallookups", EXTERNAL_LOOKUP_CONCURRENCY, true ); external_put_pool = new ThreadPool("DHTControl:puts", EXTERNAL_PUT_CONCURRENCY, true ); thread_pool.run( task, high_priority, true);