AllTestsActivity.TestControlThread
JavaScript is disabled on your browser.

br.usp.ime.dspbenchmarking.activities

Class AllTestsActivity.TestControlThread

  • java.lang.Object
    • java.lang.Thread
      • br.usp.ime.dspbenchmarking.activities.AllTestsActivity.TestControlThread
  • All Implemented Interfaces:
    java.lang.Runnable
    Enclosing class:
    AllTestsActivity


    protected class AllTestsActivity.TestControlThread
    extends java.lang.Thread
    This is the thread that actually runs and controls tests. It communicates with the main thread by means of messages to control the DSP thread configuration, suspension and resuming.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void run()
      Run all tests, phase 1 and phase 2 as described above in the class definition.
      private void sendMessage(java.lang.String action, int bSize, DspThread.AlgorithmEnum alg, int mdCycles, long totalTime, int stressParam)
      Send a control message to main thread using the message handler.
      void stopControlThread()
      Set a variable to stop the control thread.
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • controlThreadRunning

        private boolean controlThreadRunning
      • mHandler

        private Handler mHandler
      • messageHandlerTaskDone

        private boolean messageHandlerTaskDone
      • cHandler

        Handles a message to set the message handler task as done.
    • Constructor Detail

      • AllTestsActivity.TestControlThread

        public AllTestsActivity.TestControlThread(Handler handler)
        Initialize the thread by storing the message handler.
        Parameters:
        handler -
    • Method Detail

      • stopControlThread

        public void stopControlThread()
        Set a variable to stop the control thread.
      • sendMessage

        private void sendMessage(java.lang.String action,
                       int bSize,
                       DspThread.AlgorithmEnum alg,
                       int mdCycles,
                       long totalTime,
                       int stressParam)
        Send a control message to main thread using the message handler. The action string is mandatory, and all other fields will just be set in the message if their value is bigger or equal to 0.
        Parameters:
        action -
        blockSize -
        algorithm -
        maxDspCycles -
      • run

        public void run()
        Run all tests, phase 1 and phase 2 as described above in the class definition. The integers that represent algorithms are given by the order of the algorithms definition in 'res/values/strings.xml' (yeah, that is awful and if you have the time to improve it please do a pull request in the repo :P ).
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread