Are the runnables posted in runInContext, runInContextSync, runInContextAsync run in threads created in thread pool? Do the application context and system context share the thread pool or do they have seperate pools?
Today, there is only a single thread pool used to handle both System and Application runInContext requests. We use a combination of Thread Local Storage and ThreadGroups to "disguise" one of these threads as being associated with an application (or with the system).
I have a task on my plate for the 1.2 release (release date not yet established) to revisit this design due to a bug that was brought to our attention last year (IssueTracker 109). I have already implemented an initial version of a new design which uses separate threads pools for the system and for each application. The implementation is maintained in a separate branch:
My current design uses pools with a static thread count (with a configurable number of threads). I have only tested simple applications with this implementation. I haven't gotten around to the guides yet. My next thought was to implement an algorithm in which individual thread pools would be allowed to grow when needed and then a watchdog thread would observe all of the thread pools and reduce their sizes when their average usage goes down.
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.