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 86760 - ParserQueue needs high priority subqueue
Summary: ParserQueue needs high priority subqueue
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Alexey Vladykin
URL:
Keywords:
Depends on:
Blocks: 87684 92235
  Show dependency tree
 
Reported: 2006-10-09 11:55 UTC by Vladimir Voskresensky
Modified: 2008-06-02 13:50 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Voskresensky 2006-10-09 11:55:18 UTC
Problem:
The current mechanism of getting next file to parse uses top of alone queue.
Suppose, we got file1.cc for current parsing,
then we try to use model client (i.e. completion) for file2.cc => it will be put
in the head of queue with expectation to be next parsed.
But this is not the case. Because during parsing phase of file1.cc all included
user headers will be added to the head as well => file2.cc will be shifted from
head by other files => responsiveness is low than expected.

Possible solution:
- introduce "high priority" subque for code model clients like hyperlink and
code completion
- these clients calls scheduleParsing(true) on file (using CsmUtils.findFile) =>
this could be used as adding to high priority queue
- during parsing file from hight priority queue we put included files in usual queue

Additional:
- we can introduce special thread waiting on this queue
Comment 1 Alexey Vladykin 2008-06-02 13:50:52 UTC
Fixed in changeset http://hg.netbeans.org/main/rev/ae2b4fe1463c
ParserQueue is reimplemented on top of standard PriorityQueue.
Now there are three options when adding a file to the queue:
- add(file, Position.HEAD) - works like former addLast;
- add(file, Position.TAIL) - works like former addFirst;
- add(file, Position.IMMEDIATE) - adds file to high priority subqueue.
High priority files are parsed in FIFO order before all files added to HEAD or TAIL.