Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UI hang in _setBounds on OS X 10.3.8,9



On Jan 26, 2007, at 1:32 PM, Doug Zwick wrote:

<snip good analysis that I didn't read before sending my email>

Assuming that CWindow is a native AWT implementation helper class,

Yup, it's a native peer.


and given that most Cocoa windowing functions must be done from the AppKit thread,

For all practical purposes, "most" == "all", unfortunately :(


I'm guessing that CWindow has queued the setFrame operation up for the AppKit thread to perform, and is awaiting completion.

The AppKit thread has CWindow trying to execute the queued operations from Java. It's holding a native lock while doing so, and (unfortunately) also trying to ask Java about some state, which requires grabbing the AWTTreeLock.


The AWT EventThread has CWindow trying to put an operation on the queue... which requires grabbing the native lock. Of course, the AWT EventThread is holding onto the AWTTreeLock...


I would say that this is Apple's bug

Yup.


and that they probably didn't intend to attempt to acquire the AWTTreeLock from the AppKit thread.

Yup.


I do not envy them the task of interfacing the Swing API to AppKit.

Ohhh... the stories I could tell :)


I would love it if Apple could change the implementation architecture so that the AppKit thread *is* the AWT Event Dispatch Thread, but I'm sure that they had good reasons for separating them.

1. Not everything happens on the AWT-EDT. Until very recently, AWT operations were allowed from any thread, and many many badly written Swing apps do lots from the wrong thread.


2. Lots of badly written Java apps block the EDT for totally insane things... like network access.

3. It's possible (and not uncommon) to have multiple EDTs - Applets, for instance.


Karl

--

Q: WILL SOMEONE PLEASE EXPLAIN HOW WE GOT FROM GOD TO STRIP BOWLING???
A: Well, we were talking about God, and his Love for everyone being equal.
It's pretty simple to go from that concept to the concept that God loves
everything equally as well (actually, that might be why abandoned ideas
tend to resurface periodically - God is paying attention, even if no one
else is). Sports have got to fall into that category, and so if anyone
anywhere has ever played strip bowling, the idea is a permanent part of our
consciousness (our gestalt). Be honored that you have been chosen for this
monumental task.


Homepage:
     http://homepage.mac.com/khsu/index.html

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: UI hang in _setBounds on OS X 10.3.8,9 (From: Doug Zwick <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.