Uploaded image for project: 'MINA'
  1. MINA
  2. DIRMINA-547

Reduce unnecessary thread creation and destruction caused by IdleStatusChecker

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.0-M1
    • 2.0.0-M2
    • Core
    • None

    Description

      When there is only one service and the service is being activated and deactivated repetitively, ScheduledThreadPoolExecutor keeps being created and destructed by IdleStatusChecker, which causes big overhead. This becomes a real problem when a user uses a Connector to maintain just one connection, which is opened and closed very frequently, because the activation and the deactivation of the service follows the creation and the destruction of a session.

      The solution is make the life cycle of IdleStatusChecker thread to follow the life cycle of respective services. For now, IdleStatusChecker is a singleton and manages threads by itself. By moving all thread management code to AbstractIoService, IdleStatusChecker doesn't need to start and stop thread excessively but AbstractIoService will stop the thread when dispose() is called explicitly by user, like other worker threads.

      Attachments

        Activity

          People

            trustin Trustin Lee
            trustin Trustin Lee
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: