[haiku-commits] Re: haiku: hrev49843 - src/servers/app/drawing src/servers/app headers/private/interface

  • From: looncraz <looncraz@xxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 14 Nov 2015 12:37:07 -0600

On 11/14/2015 09:44, Julian Harnath wrote:


The cache by the way is currently not being cleaned, i.e. its 8 MiB, once filled, will stay around until the next reboot. I plan to add (when I find time again) an LRU scheme and some cleanup thread which wakes up e.g. once a minute and throws out masks which were not used for the past 5 minutes or so.

Seems if my patch is ever approved you can just use a DelayedMessage to initiate a cleanup cycle. You just have to decide which looper will handle the cleanup (Desktop, perhaps?).

DelayedMessage cleanup(fDesktop->MessagePort(), AS_CLEANUP_CACHE, DM_ONE_MINUTE_DELAY);
cleanup.Flush();

You could then service and re-issue the message in Desktop::_DispatchMessage().

Last but not least another thing which will need rework in the future is the app_server window locking. It's the reason why Web+ could (and in principle still can) freeze all of app_server drawing. It's not a new problem, it's been in app_server for ages, just wasn't visible as long as no app tries to do really large/complex drawing operations. I spent most of a day during the code sprint analyzing that issue and found out where it locks up.. have a few rough ideas how this could be resolved, but nothing concrete yet.

Yes, I ran into that quite a few times as well. Without giving each window its own read/write lock, I don't see much of a universal way to improve matters. This would require a fairly significant reworking of the Desktop logic and Desktop->ServerWindow relationship, as I see it.

I had to work around it by limiting how often redraws would be made while updating colors and by creating a list of pending color changes so only one redraw per view would occur. Before that, the app_server would unpredictably have drawing freezes when making rapid changes.

BTW, NICE WORK!!

--The loon

Other related posts: