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.

Bug 40788 - RP.getDefault().createTask().schedule can execute in parallel
Summary: RP.getDefault().createTask().schedule can execute in parallel
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 4.x
Hardware: PC Linux
: P4 blocker (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: THREAD
: 170581 (view as bug list)
Depends on:
Blocks: 180458
  Show dependency tree
 
Reported: 2004-03-05 10:15 UTC by Jaroslav Tulach
Modified: 2010-07-28 03:10 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Attempt to address the problem (4.04 KB, patch)
2010-04-12 10:22 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2004-03-05 10:15:30 UTC
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.).
Comment 1 Petr Nejedly 2004-10-29 12:35:19 UTC
Toolate to play with threading.
Comment 2 Lukas Hasik 2008-10-13 19:27:47 UTC
tondo, could you assign to a responsible person?
Comment 3 Antonin Nebuzelsky 2008-10-16 18:16:44 UTC
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.
Comment 4 Jaroslav Tulach 2008-10-17 12:20:55 UTC
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.
Comment 5 Antonin Nebuzelsky 2008-10-17 12:26:54 UTC
Wontfix.
Comment 6 Jaroslav Tulach 2009-08-19 11:59:02 UTC
*** Issue 170581 has been marked as a duplicate of this issue. ***
Comment 7 Jesse Glick 2009-08-19 16:35:54 UTC
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.
Comment 8 Jaroslav Tulach 2010-04-12 10:22:21 UTC
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.
Comment 9 Jaroslav Tulach 2010-07-27 08:56:37 UTC
Finally! core-main#95da06f756f9
Not perfect, but fixes the reported problem.
Comment 10 Quality Engineering 2010-07-28 03:10:45 UTC
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