Menu

#1031 Fully threaded Symbol Browser

Next_Release
applied
Patch
2021-01-24
2020-11-11
No

This patch restores Symbol Browser with a fully threaded implementation.

The worker thread creates and maintains two non-GUI trees. The tree class (CCTree) has almost the same interface of wxTreeCtrl, so the existing code only need a few changes.

When one of the trees changes the worker thread transfer it to the main thread using CallAfter(). The longest function called lasts less than a millisecond (and it is called once per tree refresh).

To prevent flooding the message queue I have used a semaphore, communication stops until CallAfter() is processed by the main thread.

1 Attachments

Related

Tickets: #1085

Discussion

  • ollydbg

    ollydbg - 2020-11-12
    • labels: SymbolBrowser --> SymbolBrowser, CodeCompletion
     
  • Miguel Gimenez

    Miguel Gimenez - 2020-11-22

    ollydbg has created a pre-release version including this patch so it can be easily tested.

     
  • Eckard Klotz

    Eckard Klotz - 2020-12-17

    Hello Miguel Gimenez .

    Thanks for your effort.

    I used your patch together with the Code::Blocks SVN revision 12240 also used for the last nightly of C::B from December the 13th 2020.

    • I don't face crash with my projects.
    • I think the symbol-browser content is updated a little bit slower than with an older patch-version.
      • And after changing a class it takes longer until the associated browser-tree is visible again.
      • But this is no issue for me and may be caused by my older laptop (from 2013 delivered with Win 8 now running with Win 10) .

    Are you interested in specific details which may support your work?

    Stay well and healthy,
    Eckard Klotz.

     
  • Miguel Gimenez

    Miguel Gimenez - 2020-12-17

    The tree refreshing is slower because the first version of the patch did it in a loop within the main thread (freezing the UI), while the threaded version must do it using the message queue.

    This patch won't be in a nightly until enough people test it successfully and a developer decides to commit it. I think that nightlies are good precisely for this kind of testing, but it is my personal opinion.

     
  • Morten MacFly

    Morten MacFly - 2020-12-17
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -2,6 +2,6 @@
    
     The worker thread creates and maintains two non-GUI trees. The tree class (CCTree) has almost the same interface of wxTreeCtrl, so the existing code only need a few changes.
    
    -When one of the trees changes the worker thread transfer it to the main thread using CallAfter(). The longest function called lasts less than a milisecond (and it is called once per tree refresh).
    +When one of the trees changes the worker thread transfer it to the main thread using CallAfter(). The longest function called lasts less than a millisecond (and it is called once per tree refresh).
    
     To prevent flooding the message queue I have used a semaphore, communication stops until CallAfter() is processed by the main thread.
    
    • assigned_to: Morten MacFly
    • Milestone: Next_Nightly --> Undefined
     
  • Morten MacFly

    Morten MacFly - 2020-12-17

    I am trying it myself now, too. Lets see if there are negative side-effects. Nice effort though!
    Please nag me from time to time if progress seems stalled...

     
  • Miguel Gimenez

    Miguel Gimenez - 2021-01-18

    Any progress?. Other users haven't reported problems so far...

     
  • Morten MacFly

    Morten MacFly - 2021-01-23
    • status: open --> applied
    • Milestone: Undefined --> Next_Release
     
  • Morten MacFly

    Morten MacFly - 2021-01-23

    Applied in SVN as I didn't see any issues. Thank you!

     
  • Miguel Gimenez

    Miguel Gimenez - 2021-01-23

    As reported in the forum there is a typo inside conditional code (disabled by default); in classbrowser.cpp:1188 there is only one colon in the scope operator.

     
  • Morten MacFly

    Morten MacFly - 2021-01-24

    OK - this is fixed. Id did not occur to me as I had fixed that in my working copy but not the one from which I committed to the repo... :-/

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.