Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-5295

Thread and ThreadFactory should be extensible

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.13.0
    • 0.14.0
    • C++ - Library
    • None
    • Patch Available

    Description

      Thread and ThreadFactory are both declared final, making impossible to extend them without duplicating or reimplementing much code.
      As an example, to customize thread startup with TNonblockingServer, you need to copy or reimplement not only ThreadFactory and Thread, but also Task, Runnable and TNonblockingServer.
      TNonblockingServer always creates Task instances, and Task descends from Runnable, containing a Thread pointer.

      Removing final and making some methods virtual will allow everyone to customize Thread without resorting to code duplication.

      Attachments

        Issue Links

          Activity

            People

              rghe R.Ghetta
              rghe R.Ghetta
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m