[squeak-dev] The Inbox: Morphic-ct.1690.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Fri Jun 18 17:41:16 UTC 2021


Hi Christoph.

> Do we need a second recursive lock somewhere around LazyListMorph [...]

Yes, it looks like we do. Maybe for LazyListMorph >> drawOn: so that we can skip it if it is called while currently activated.

Hmm... maybe we can also find a cheap way to support this in Morph >> #fullDrawOn:? But setting and checking such a flag would likely create too much overhead. So maybe just once in LazyListMorph.

Other places:
- Icon in IndentingListItemMorph
- Icon in PluggableButtonMorph
- ...

Hmpf. I suppose that the model could take care of it because it knows best whether its icons are dynamically created or static.

Best,
Marcel
Am 16.06.2021 16:20:40 schrieb christoph.thiede at student.hpi.uni-potsdam.de <christoph.thiede at student.hpi.uni-potsdam.de>:
Hi all, hi Marcel,

I just stumbled into another similar incident. I have a complex model that does a lazy-cached computation when it is asked the first time for the icons in a list. When the computation is run, the model spawns a progress bar to communicate the operation to the user. In theory, this would work fine, but in practice, if the computation takes more than 1 second to run, the progress bar will redraw the world and thus an almost-infinite loop occurs. Actually, after ~10 iterations the computation succeeds for an unknown reason, but it definitively is very inefficient and looks somehow awkward:

["awkward-progressbar.png"]

Do we need a second recursive lock somewhere around LazyListMorph >> #icon:? Or would you instead suggest to move this responsibility into the model? Conceptually, however, that approach would feel wrong to me because it is the view which defines the special recursive behavior in this case.

Here is the relevant recursive stack slice:

... stuff in model ...
PluggableMultiColumnListMorph>>iconAt:column:
LazyListMorph>>getListIcon:
LazyListMorph>>icon:
LazyListMorph>>iconExtent
LazyListMorph>>widthToDisplayItem:
LazyListMorph>>item:
LazyListMorph>>drawOn:
LazyListMorph(Morph)>>fullDrawOn:
[] in [] in PluggableMultiColumnListMorph(Morph)>>drawSubmorphsOn:
[] in PluggableMultiColumnListMorph(Morph)>>drawSubmorphsOn:
PluggableMultiColumnListMorph(Morph)>>drawSubmorphsOn:
PluggableMultiColumnListMorph(Morph)>>fullDrawOn:
...
PasteUpMorph>>displayWorld
[] in SystemProgressMorph>>position:label:min:max:
...
... stuff in model ...
PluggableMultiColumnListMorph>>iconAt:column:
LazyListMorph>>getListIcon:
LazyListMorph>>icon:
...

Best,
Christoph

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210618/386c6401/attachment-0001.html>


More information about the Squeak-dev mailing list