ThreadPoolExecutor is the better way to go with this, but you could also try ForkJoinPool if that helps, or check out LMAX:
https://github.com/LMAX-Exchange/disruptor On 21 July 2014 22:48, marks1900 <[email protected]> wrote: > Matt Sicker wrote > > The Java APIs themselves. They recommend the executor classes and the > > java.util.concurrent classes in general. > > > > -- > > Matt Sicker < > > > boards@ > > > > > > Can you point me to any documentation on this? > > == Some Thoughts == > > I did a quick look at the ThreadPoolExecutor class and it seems that all I > have to do is supply my own ThreadFactory to achieve my own custom threads. > > The > > http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ThreadPoolExecutor.html > class documentation mentions under the header "Creating new threads" that > > > > By supplying a different ThreadFactory, you can alter the thread's name, > > thread group, priority, daemon status, etc. > > For example, see the MaxPriorityThreadFactory class described here: > > http://java-latte.blogspot.ca/2014/03/executor-executorservice-threadpool-and.html > > > > == The Issue == > > My specific situation is that I have a multi-threaded web application where > one CPU intensive low-priority-background processing thread is not playing > fairly with other threads. My thinking is that if I could drop the Thread > priority for the processing thread, I can get a much better outcome. > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Thread-pool-profiles-Thread-currentThread-setPriority-MIN-PRIORITY-tp5754039p5754176.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Matt Sicker <[email protected]>
