com.neeve.daemon.thread
Class DmnThreadManager

java.lang.Object
  extended by com.neeve.root.RootObject
      extended by com.neeve.daemon.thread.DmnThreadManager

public class DmnThreadManager
extends RootObject

The daemon thread manager class.

This class is the base class for all daemon thread manager classes. This class creates the thread pool.

Threading:
This class is safe for concurrent access by multiple threads.

Method Summary
 DmnThreadPool getThreadPool()
           
 void init(int numIOThreads, long[] ioThreadCpuAffinityMasks, int maxOnDemandThreads)
          Initialize the daemon thread manager.
 void shutdown()
          Shutdown the thread manager This method shuts down the thread manager.
 void start()
          Start the thread manager.
 
Methods inherited from class com.neeve.root.RootObject
getChecked, getThreaded, getTracer, setChecked, setTracer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

init

public final void init(int numIOThreads,
                       long[] ioThreadCpuAffinityMasks,
                       int maxOnDemandThreads)
                throws Exception
Initialize the daemon thread manager.

Parameters:
numIOThreads - The number of I/O threads to initialize the pool with. This parameter is ignored in case the service is operating in single threaded mode.
ioThreadCpuAffinityMasks - The array of CPU thread affinites one for each IO thread.
maxOnDemandThreads - Specifies the maximum number of on-demand threads that can be created. This parameter is ignored in case the service is operating in single threaded mode since no on-demand theads can be created if operating single threaded.

This method initializes the thread pool.

Throws:
Exception
Threading:
This method is not safe for concurrent access by multiple threads and can only be invoked once in the life of the thread manager.

start

public final void start()
Start the thread manager.

This method starts the thread manager. It does do by starting the thread pool. This method does not return until shutdown() is invoked.

Threading:
This method is not safe for concurrent access by multiple threads and can only be invoked once in the life of the thread pool i.e. after initializing the pool. The thread that invokes this method must be the thread that initialized the pool i.e. the admin thread.

getThreadPool

public final DmnThreadPool getThreadPool()

shutdown

public final void shutdown()
Shutdown the thread manager

This method shuts down the thread manager. It does do by shuttinf down the thread pool. This method can be called in any state i.e.
1. create()->shutdown() 2. create()->init()->shutdown() 3. create()->init()->start()->shutdown()

Threading:
This method is not safe for concurrent access by multiple threads and can only be invoked once in the life of the thread pool i.e. the last method. The thread that invokes this method must be the thread that initialized the pool i.e. the admin thread.


Copyright © 2015 Neeve Research, LLC. All Rights Reserved.