WaitForParse Issues...

SyntaxEditor for Windows Forms Forum

Posted 16 years ago by Dave Conkey
Version: 4.0.0281
Platform: .NET 2.0
Environment: Windows Vista (32-bit)
Avatar
I'm having a lot of problems using WaitForParse and the SemanticParserService. WaitForParse seems to wait for the maximum wait time under various circumstances (while using zero CPU). While I have not fully characterized all the circumstances under which it happens, it consistently happens if WaitForParse is called in rapid succession in my project. It seems like some sort of race condition. If the SemanticParserService isn't running it appears to work fine. I'll email some sample code.

Also, is there any way to see if WaitForParse finished in the time allotted? This seems fairly critical since you may want to skip some logic if the semantic data isn't up to date. I'd have expected WaitForParse to return true/false.

Comments (1)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Dave,

There are some known issues with WaitForParse that we would like to try and resolve in the future but would likely require some big changes. The main problem is that a parsing operation on the separate thread eventually has to call back to the main UI thread when the UI needs to update outlining, etc. based on a parsed compilation unit from the semantic parsing operation.

When it reaches this callback, your code calling WaitForParse is blocking the main thread, which therefore blocks the parsing operation from finishing since the last part of it is waiting for the main thread to open up again.

I would rather suggest that you only call WaitForParse with smaller intervals like 500ms or less. I will add an item to the TODO list to have that method return a bool as to whether the requested parse hash key is still being processed or queued for processing.


Actipro Software Support

The latest build of this product (v24.1.1) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.