Documentation of 'org.encog.util.concurrency.EngineConcurrency' Java class
EngineConcurrency
org.encog.util.concurrency

Class EngineConcurrency

  • All Implemented Interfaces:
    MultiThreadable


    public class EngineConcurrency
    extends java.lang.Object
    implements MultiThreadable
    This class abstracts thread pools, and potentially grids and other types of concurrency. It is used by other classes inside of Encog to allow tasks to be executed efficiently on multicore machines.
    • Constructor Detail

      • EngineConcurrency

        public EngineConcurrency()
        Construct a concurrency object.
    • Method Detail

      • getInstance

        public static EngineConcurrency getInstance()
        Returns:
        The instance to the singleton.
      • setThreadCount

        public void setThreadCount(int t)
        Set the number of threads to use.
        Specified by:
        setThreadCount in interface MultiThreadable
        Parameters:
        t - The number of threads to use, or zero to automatically determine based on core count.
      • checkError

        public void checkError()
        Check to see if one of the threads has thrown an error. If so, then throw that error.
      • createTaskGroup

        public TaskGroup createTaskGroup()
        Create a new task group.
        Returns:
        The new task group.
      • processTask

        public void processTask(EngineTask task)
        Process the specified task.
        Parameters:
        task - The task to process.
      • processTask

        public void processTask(EngineTask task,
                                TaskGroup group)
        Process the specified task. It will be processed either now, or queued to process on the thread pool.
        Parameters:
        task - The task to process.
        group - The task group.
      • registerError

        public void registerError(java.lang.Throwable t)
        Allows threads to register errors, these errors will be thrown by the main thread.
        Parameters:
        t - The error to register.
      • shutdown

        public void shutdown(long timeout)
        Wait for all threads in the pool to complete.
        Parameters:
        timeout - How long to wait for all threads to complete.
      • getThreadCount

        public int getThreadCount()
        Specified by:
        getThreadCount in interface MultiThreadable
        Returns:
        The number of threads to use, 0 to automatically determine based on core count.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.