This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
See discussion in issue #170554 for background. I am aware of the throughput parameter but my expectation would be that a single task would never be run in multiple threads regardless of throughput, that only _distinct_ tasks would be run in parallel. This expectation indeed seems to hold - unless you pick the special value 0 for the delay. Example: import java.util.Random; import org.openide.util.Exceptions; import org.openide.util.RequestProcessor; public class Run implements Runnable { public static void main(String[] args) throws InterruptedException { RequestProcessor r = RequestProcessor.getDefault(); // RequestProcessor r = new RequestProcessor("r", 1); RequestProcessor.Task t = r.create(new Run()); int delay = 0; // int delay = 1; t.schedule(delay); t.schedule(delay); t.schedule(delay); t.schedule(delay); // t.waitFinished(); Thread.sleep(4000); } public void run() { int i = new Random().nextInt(1000); System.err.println("start #" +i); try { Thread.sleep(i); } catch (InterruptedException ex) { Exceptions.printStackTrace(ex); } System.err.println("end #" +i); } } Using a serializing RP makes the tasks run serially, but so does using a delay of 1msec instead of 0. It is very likely this behavior was never intentional, but if 0 is indeed a magical value for schedule then this must be documented.
Long time known issue. Probably just learn to live with it. Unless Nejedlák decides to tease himself and fix it. *** This issue has been marked as a duplicate of 40788 ***
If known bugs will not be fixed, I guess I cannot trust RequestProcessor and should use java.util.concurrent.* exclusively.
Integrated into 'main-golden', will be available in build *200908210201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/b92ce4c04b39 User: Jesse Glick <jglick@netbeans.org> Log: #170581: serialize refreshes.