Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [vtp-dev] FW: vtp-dev messages

> - Could you use Cocoa Java classes to do all this inside Java? Maybe
even
> moving part of it to the java side would increase the reliability of
some of
> the tasks that are crashing out.
>  (Saw an example at
http://lists.apple.com/archives/Java-dev/2004/Feb/msg01079.html)

Even in this example, they're magically getting the main run loop in
order to attach a timer to it.  I don't think the JNI bridge is causing
any of the trouble, as I've ensured that all those callbacks are working
the way they're intended.

> - The apple docs mention that you just start up a thread and it will
have a
> new nsrunloop. What is the limitation that is preventing you from
doing
> that? Maybe if you started the thread on the java side and then
launched
> into JNI it would solve some of your problems.
>   (See
>
http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC
_cla
> ssic/Classes/NSRunLoop.html)

Hm, I might be able to do something with this...  My inexperience with
multi-threaded Cocoa applications is standing in the way here.  From
what I understood (talking to the #mac-dev guys on freenode), the Cocoa
event/GUI framework responds very poorly to being run outside of its
main thread, but I didn't verify.  I imagine that if I can get a run
loop in a separate thread, I can fire a timer and process the Skype
message events myself (and bypass the primary Cocoa event handler),
possibly avoiding the crashing.

> You may also have some luck starting from the opposite direction;
getting
> things working in a standalone cocoa app, then either moving straight
to
> Eclipse or moving to a standalone java app. I've had a lot of success
going
> this route; it helps eliminate some of the problem variables and and
reduces
> the pain of a crash.

Yep, this is exactly the route I took.  I got the standalone application
working great, and I got the JNI library working great on its own and
loaded by the Eclipse plugin.  Mixing the two ended up being the
problem, as is usually the case!

Thanks for the feedback,
-- Shaun


Back to the top