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.
t = RP.getDefault().createTask(); t.schedule (9); t.schedule (17); for tasks that take more than 20ms leads to parael execution, which is bad and can cause various problems (issue 40693) to users as well as semantics (notifyFinished, etc.).
Toolate to play with threading.
tondo, could you assign to a responsible person?
Jardo, what do you suggest? Forbidding the parallel execution would be a semantic change of the APIs. Is it necessary. The code which calls schedule() should know if it wants parallel execution or not and do what's appropriate IMO.
Doing the change trivially would be incompatible. This is not what we can risk in this area. If the bug shall be fixed at all, then we need to introduce it "conditionally". However I am not aware of any really visible bug report related to this problem. Take this as an open invitation to close as won't fix, if you want to risk the consequences.
Wontfix.
*** Issue 170581 has been marked as a duplicate of this issue. ***
Bit me in issue #170581, which see for details - in a sample program, schedule(1) works fine but schedule(0) is broken. Workaround is straightforward (make a custom RP with throughput=1) but there may be undiscovered symptoms of this bug.
Created attachment 97061 [details] Attempt to address the problem The previous patch (does not fully work) knows that a task is currently running and if so, it does not reschedule it. It waits for the task to finish and schedule itself. This avoids parallel execution of the same task.
Finally! core-main#95da06f756f9 Not perfect, but fixes the reported problem.
Integrated into 'main-golden', will be available in build *201007280001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/95da06f756f9 User: Jaroslav Tulach <jtulach@netbeans.org> Log: #40788: Eliminate parallel execution of the same task on multithroughput RequestProcessor