pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gk_br...@verizon.net>
Subject Re: What is legal to do in second thread?
Date Fri, 22 Apr 2011 17:06:33 GMT
> Trying to understand the Pivot threading model:  what is okay to do in a background thread
re: the GUI objects?
> -          Is it legal to change the data model (of a TreeView or similar)?

Nope.

> -          Is it legal to update the text of a TextInput (or similar)?

Nope.

> What are the implications of doing things that aren’t “legal”?  Are we threatening
to crash or destabilize the JVM? 

Probably not.

> Or is it that we may have race conditions or data corruption because data structures
are not thread-safe?

Yes, that is possible.

Pivot's threading model is basically the same as Swing's - any UI updates need to be done
on the UI thread. Any time you want to call into the UI thread from a background thread, you
need to call ApplicationContext#queueCallback().

G


Mime
View raw message