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

Summary: ParserQueue needs high priority subqueue
Product: cnd Reporter: Vladimir Voskresensky <vv159170>
Component: Code ModelAssignee: Alexey Vladykin <alexey_vladykin>
Status: RESOLVED FIXED    
Severity: blocker    
Priority: P2    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on:    
Bug Blocks: 87684, 92235    

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.