Class JCACommandThread

  • All Implemented Interfaces:

    public class JCACommandThread
    extends Thread
    JCA command pump, added for two reasons:
    1. JCA callbacks can't directly send JCA commands without danger of a deadlock, at least not with JNI and the "DirectRequestDispatcher".
    2. Instead of calling 'flushIO' after each command, this thread allows for a few requests to queue up, then periodically pumps them out with only a final 'flush'
    Initial version:CSS, 4-Jun-2012, Luofeng Li:added codes to support for the new archiver
    Kay Kasemir
    • Constructor Detail

      • JCACommandThread

        public JCACommandThread​(ConfigService configService)
        Construct, but don't start the thread.
        configService - ConfigService
        See Also:
    • Method Detail

      • start

        public void start()
        Version of start that may be called multiple times.

        The thread must only be started after the first PV has been created. Otherwise, if flush is called without PVs, JNI JCA reports pthread errors.

        NOP when already running

        start in class Thread
      • addCommand

        public void addCommand​(Runnable command)
        Add a command to the queue. add some cap on the command queue? At least for value updates?
        command - Runnable
      • run

        public void run()
        Specified by:
        run in interface Runnable
        run in class Thread