Java tutorial
//package com.java2s; //License from project: GNU General Public License public class Main { public static Thread getLowPriorityBackgroundThread(Runnable runnable) { Thread thread = getBackgroundThread(runnable); thread.setPriority(Thread.MIN_PRIORITY + 1); // keep other stuff running // smoothly return thread; } public static Thread getBackgroundThread(Runnable runnable) { Thread thread = new Thread(runnable); thread.setDaemon(true); // will not block JVM shutdown return thread; } }