[Cuis-dev] #redrawNeeded from background processes

Phil B pbpublist at gmail.com
Sat Jun 1 04:05:21 PDT 2019


Every now and then when sending #redrawNeeded from a background process,
you'll probably find you get an 'attempt to index non-existent element in
an ordered collection' error in DamageRecorder.  This is because
DamageRecorder is not thread-safe (OK, process-safe)  I've found this to be
a miserable problem to deal with because even if you're trying to be good
and only message morphs from the UI process, finding all the places/ways
that #redrawNeeded can get called can be tricky if your Morph is updating
based on events from background processes.

The attached changeset fixes that... now you can send #redrawNeeded from
wherever you want, whenever you want. (at least I haven't been able kill it
yet)  This doesn't appear to have any adverse drawing performance impact
that I've been able to measure.

Thanks,
Phil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20190601/2b917bdc/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3782-BackgroundSafeRedrawNeeded-PhilBellalouna-2019Jun01-05h20m-pb.1.cs.st
Type: application/octet-stream
Size: 10873 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20190601/2b917bdc/attachment-0001.obj>


More information about the Cuis-dev mailing list