[BUG] troubles with damage management
Ned Konz
ned at bike-nomad.com
Wed Jan 8 03:32:34 UTC 2003
On Tuesday 07 January 2003 06:19 pm, RossBoylan at stanfordalumni.org
wrote:
> My application has a thread that ticks away and causes some updates
> to the display. It may be relevant that the errors are being
> raised from that thread, rather than my main thread (the top of the
> stack shows how it started). [Or do I mean the bottom?
> Graphically it's at the end of the list below, but its the first
> item on the stack.]
Hi Ross,
Morphic is single-threaded.
But it looks like you're invalidating Morphs from a non-UI thread.
Doing this can cause problems, as you've found.
The assumption in the code is that the DamageRecorder is accessed from
a single thread, at the right time.
If you really want to update Morphs from a background thread, I'd
recommend to do one of:
* WorldState addDeferredUIMessage: valuableObject
where valuableObject is usually a BlockContext or MessageSend (anyway,
something that can respond to #value)
or
* use a SharedQueue and call #nextOrNil on it from a regular #step
message (in the main UI thread). This queue would have data or
instructions (like, perhaps, MessageSends) that would specify how to
change the morphs.
--
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE
More information about the Squeak-dev
mailing list
|