Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-20199

Complete support of Virtual Threads

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • 4.x
    • came-core
    • None
    • Unknown

    Description

      For full support of Virtual Threads, several sub-tasks need to be done:

      • Avoid Lengthy and Frequent Pinning by replacing synchronized blocks with ReentrantLocks (use the option -Djdk.tracePinnedThreads=ful to print stack traces when a thread blocks while pinned)
      • Don't Cache Expensive Reusable Objects in Thread-Local Variables by avoiding thread locals when possible since when using Virtual Threads, the objects will never be reused so if the thread-local variables are never reset, it will end up with an OOME.
      • Use Semaphores to Limit Concurrency instead of relying on the size of the thread pool when applicable
      • Allow to expose ThreadPerTaskExecutor through JMX indeed so far it is limited to ThreadPoolExecutor

      References https://docs.oracle.com/en/java/javase/21/core/virtual-threads.html

      Attachments

        Issue Links

          Activity

            People

              gnodet Guillaume Nodet
              nfilotto Nicolas Filotto
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: