Posted 16 years ago
by Adam Dickinson
Version: 4.0.0280
Platform: .NET 2.0
Environment: Windows XP (32-bit)
Hi,
My application is a project-based multi-document editor. When the user loads a project, I pre-parse all of its code files using the SemanticParserService and the SemanticParserServiceRequest constructor that takes in the text, rather than the Document. I sit and wait on a loading dialog until SemanticParserService.PendingRequestCount is 0. The problem is that some of my parse requests are not returning any results. That is, they are never calling my ISemanticParseDataTarget.NotifySemanticParseComplete() function.
I added my own parse request tracking. Immediately after calling SemanticParserService.Parse, I make sure the SemanticParserService has it pending. Later when SemanticParserService.PendingRequestCount is 0, I see which of my requests are still pending in my tracker. Here's an example of what I'm seeing in a project with 241 files (I have projects which as many as 3300 files that have the same problems). The PendingRequestCount is the number of requests in the queue immediately before that request was made.There's nothing obviously wrong with the files that are lost. After the project has loaded, I can open those files and they get parsed just fine. What is strange is each file that I open has the same problem as in the first line. SemanticParserService.HasPendingRequest() returns false, but the file gets parsed anyways.
What may be weird on my end is that my ISemanticParseDataTarget.NotifySemanticParseComplete() function can fire off additional parse requests. I request for the file's dependencies to be parsed if they haven't been already. I've added a Mutex around the SemanticParserService whereever its called and it has cleaned up a couple of minor things, but the same files are being skipped every time.
I'm going to try re-requesting the skipped files, but I would sure like to know if there's anything I'm doing wrong. Please help.
Thanks in advance.
UPDATE:
I added the re-request and am still getting some unexpected behavior. (I added some helpful text before my re-queues.)My best guess now is that I need to add some Thread.Sleep()s in and around my requests. Or maybe I need to make sure my requests are made from the main thread so that the SemanticParserService accessors return accurate and up-to-date values? What do you think?
[Modified at 02/04/2009 07:54 PM]
My application is a project-based multi-document editor. When the user loads a project, I pre-parse all of its code files using the SemanticParserService and the SemanticParserServiceRequest constructor that takes in the text, rather than the Document. I sit and wait on a loading dialog until SemanticParserService.PendingRequestCount is 0. The problem is that some of my parse requests are not returning any results. That is, they are never calling my ISemanticParseDataTarget.NotifySemanticParseComplete() function.
I added my own parse request tracking. Immediately after calling SemanticParserService.Parse, I make sure the SemanticParserService has it pending. Later when SemanticParserService.PendingRequestCount is 0, I see which of my requests are still pending in my tracker. Here's an example of what I'm seeing in a project with 241 files (I have projects which as many as 3300 files that have the same problems). The PendingRequestCount is the number of requests in the queue immediately before that request was made.
Failed to add SemanticParserServiceRequest (Request #0).
Request #111 did not finish parsing (PendingRequestCount=110)
Request #118 did not finish parsing (PendingRequestCount=116)
Request #120 did not finish parsing (PendingRequestCount=117)
Request #126 did not finish parsing (PendingRequestCount=122)
Request #128 did not finish parsing (PendingRequestCount=123)
Request #130 did not finish parsing (PendingRequestCount=124)
Request #134 did not finish parsing (PendingRequestCount=127)
Request #136 did not finish parsing (PendingRequestCount=128)
Request #142 did not finish parsing (PendingRequestCount=133)
Request #144 did not finish parsing (PendingRequestCount=134)
Request #146 did not finish parsing (PendingRequestCount=135)
Request #149 did not finish parsing (PendingRequestCount=137)
Request #213 did not finish parsing (PendingRequestCount=187)
Request #214 did not finish parsing (PendingRequestCount=188)
Request #216 did not finish parsing (PendingRequestCount=189)
Request #217 did not finish parsing (PendingRequestCount=189)
Request #218 did not finish parsing (PendingRequestCount=189)
Request #221 did not finish parsing (PendingRequestCount=190)
Request #223 did not finish parsing (PendingRequestCount=190)
Request #233 did not finish parsing (PendingRequestCount=200)
Request #234 did not finish parsing (PendingRequestCount=200)
What may be weird on my end is that my ISemanticParseDataTarget.NotifySemanticParseComplete() function can fire off additional parse requests. I request for the file's dependencies to be parsed if they haven't been already. I've added a Mutex around the SemanticParserService whereever its called and it has cleaned up a couple of minor things, but the same files are being skipped every time.
I'm going to try re-requesting the skipped files, but I would sure like to know if there's anything I'm doing wrong. Please help.
Thanks in advance.
UPDATE:
I added the re-request and am still getting some unexpected behavior. (I added some helpful text before my re-queues.)
We have 6 request(s) that did not finish:
Request #242 did not finish parsing (PendingRequestCount=1)
Request #255 did not finish parsing (PendingRequestCount=14)
Request #256 did not finish parsing (PendingRequestCount=14)
Request #257 did not finish parsing (PendingRequestCount=14)
Request #258 did not finish parsing (PendingRequestCount=14)
Request #260 did not finish parsing (PendingRequestCount=14)
We have 4 request(s) that did not finish:
Request #262 did not finish parsing (PendingRequestCount=0)
Request #263 did not finish parsing (PendingRequestCount=1)
Request #264 did not finish parsing (PendingRequestCount=1)
Request #265 did not finish parsing (PendingRequestCount=1)
We have 3 request(s) that did not finish:
Request #268 did not finish parsing (PendingRequestCount=0)
Request #269 did not finish parsing (PendingRequestCount=1)
Request #270 did not finish parsing (PendingRequestCount=1)
We have 2 request(s) that did not finish:
Request #272 did not finish parsing (PendingRequestCount=0)
Request #273 did not finish parsing (PendingRequestCount=1)
We have 1 request(s) that did not finish:
Request #275 did not finish parsing (PendingRequestCount=0)
[Modified at 02/04/2009 07:54 PM]