Well folks its like this. I have SuSE 5.3, kernel 2.0.35,
/lib/libc.so.5.4.46, and jdk 1.1.7 with green threads . I have not
upgraded to 1.2 because of glibc (yea I know I need to make the leap).
Now I tried the native methods examples for the jni 1.1 model and can do
most direct calls to C code. I can even call Java code while in a thread
spawned from Java. Yet when I try to do a callback from a thread spawned
by an event in the C side of things it just aint talkin folks.

I did the Dejanews and looked in the archives and still didn't find
anything concrete but I suspect I need native threads (are these the
dreaded OSF/POSIX pthreads? Yuck, I still have nightmares about non
threadsafe libraries on HPUX). Now this poses a question. How does AWT
do callbacks from the Motif code?

Could they be using the 1.0 native interface? So I tried it after I
dusted off my copy of first edition Java Tutorial and low and behold
what I could not get to work in jni 1.1 works just fine in 1.0 style
jni. Well I thought the 1.0 model seems more OOP because you deal with
the objects (OK encapsulation is toast), the interface is less
obfuscated to these tired C/C++/Java coding eyes, but it looks Muy
Pelegroso (Very Dangerous). As a current Java developer I had to perform
a couple of old religious rituals like open my old 1978 copy of K&R
(without further damaging it), chant the entire section on pointers, and
key in the original HelloWorld.c to prepare myself for this journey. I
briefly considered calling my Sensei to discuss this journey into the
art of C but figured she'd just call the cops (she doesn't hack code).
Then I hacked the callback code using the jni 1.0 technique and it
worked first try (sort of).

My only concern is if the 1.0 model will be going away soon. Don't want
to invest too much in stuff that is not likely to be around next year.
Yet I want it to work as well on green threads as native threads. So,
how does the AWT do it?

--
Tony Dean
Linux: The choice of a GNU Generation!



----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to