squeak crash when updating morph in background
Bob Arning
arning at charm.net
Fri Aug 29 19:06:02 UTC 2003
On Fri, 29 Aug 2003 20:37:48 +0200 "ALR" <alr.dev at free.fr> wrote:
>My feeling is that there must be races condition problems with the UI thread
>and my background process.
>Are there any 'trade-off' about UI and multi-threading issues ?
Very much so. Much of Morphic is not thread-safe and assumes that no other Process is making concurrent adjustments to the World, its submorphs or their attributes. The smart thing to do is to have your background process do non-UI stuff (I see #testODBC, so I assume this would include reading a database) and then let the UI process handle the UI part of the task. Your background process could look something like:
...
records _ self readDatabase.
WorldState addDeferredUIMessage: [listMorph addTheseRecords: records].
...
Cheers,
Bob
More information about the Squeak-dev
mailing list
|