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: Conflict between Application and StartOnMainThread




On Apr 7, 2007, at 8:09 AM, Robin Sheat wrote:

On Sunday 08 April 2007 00:46:04 Michael Hall wrote:
What you could do is have the launcher run off of it's own thread
that just idles but includes the event handler.
No, I tried that. It makes SWT unhappy. I think the events expect to have the
primary thread, and SWT expects to have it too, and so you can either have
events and no UI, or the UI and no events.


My guess there might be that the OS X events are set up to be delivered on the main thread. There is no reason, assuming you can receive them at all, that you couldn't immediately pass their processing off to another thread once you have them. You aren't required to stay on the main thread.

It seems then there might be a solution to the threading problem
after all? Without looking I'm not sure what it would be either.
Maybe someone else on the list might still have suggestions there.
I've spent a bit of time on #azureus-hackers and looking through the Azureus
source code. There seems to be some real black magic going on there. It's
using a combination of JNI and swt.internal.carbon hooks into the OS to do
it.


If they are throwing Carbon into the mix then they also get additional points for a even greater degree of difficulty.


Mike Hall mikehall at spacestar dot net http://www.spacestar.net/users/mikehall http://sourceforge.net/projects/macnative



_______________________________________________
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: Conflict between Application and StartOnMainThread (From: Robin Sheat <email@hidden>)
 >Re: Conflict between Application and StartOnMainThread (From: Michael Hall <email@hidden>)
 >Re: Conflict between Application and StartOnMainThread (From: Robin Sheat <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.