Return-Path: X-Original-To: apmail-pivot-user-archive@www.apache.org Delivered-To: apmail-pivot-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2BAD91745 for ; Fri, 22 Apr 2011 18:05:48 +0000 (UTC) Received: (qmail 63992 invoked by uid 500); 22 Apr 2011 18:05:48 -0000 Delivered-To: apmail-pivot-user-archive@pivot.apache.org Received: (qmail 63970 invoked by uid 500); 22 Apr 2011 18:05:48 -0000 Mailing-List: contact user-help@pivot.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@pivot.apache.org Delivered-To: mailing list user@pivot.apache.org Received: (qmail 63962 invoked by uid 99); 22 Apr 2011 18:05:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Apr 2011 18:05:47 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of Roger.Whitcomb@ingres.com designates 69.18.216.40 as permitted sender) Received: from [69.18.216.40] (HELO mail.ingres.com) (69.18.216.40) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Apr 2011 18:05:41 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CC0117.D7783646" Subject: RE: What is legal to do in second thread? Date: Fri, 22 Apr 2011 14:05:19 -0400 Message-ID: In-Reply-To: <24AF2E7F-1101-43F8-BA07-FF629B658418@verizon.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: What is legal to do in second thread? Thread-Index: AcwBD8DzMjSybSPHTfG4fFMavkIlnAAB/99Q References: <24AF2E7F-1101-43F8-BA07-FF629B658418@verizon.net> From: "Roger L. Whitcomb" To: X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. ------_=_NextPart_001_01CC0117.D7783646 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks, Greg. =20 Roger Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com | Ingres | 500 Arguello Street | Suite 200 | Redwood City | CA | 94063 | USA | = +1 650-587-5596 | fax: +1 650-587-5550 From: Greg Brown [mailto:gk_brown@verizon.net]=20 Sent: Friday, April 22, 2011 10:07 AM To: user@pivot.apache.org Subject: Re: What is legal to do in second thread? =20 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)? =20 Nope. - Is it legal to update the text of a TextInput (or similar)? =20 Nope. What are the implications of doing things that aren't "legal"? Are we threatening to crash or destabilize the JVM? =20 =20 Probably not. Or is it that we may have race conditions or data corruption because data structures are not thread-safe? =20 Yes, that is possible. =20 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(). =20 G =20 ------_=_NextPart_001_01CC0117.D7783646 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Thanks, Greg.

 

Rog= er Whitcomb | Architect, Engineering | Roger.Whitcomb@ingres.com| Ingres | = = 500 Arguello Street | Suite 200 | Redwood City | CA = | 94063 | USA &nb= sp;| +1 650-587-5596 | fax: +1 650-587-5550

From:= = Greg Brown [mailto:gk_brown@verizon.net]
Sent: Friday, April = 22, 2011 10:07 AM
To: user@pivot.apache.org
Subject: = Re: What is legal to do in second = thread?

 

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

 

------_=_NextPart_001_01CC0117.D7783646--