"proper" place for the .so native libraries

1999-09-30 Thread Brett Smith

Where is the "proper" location for the *.so native library files?

One JNI tutorial said the following:
LD_LIBRARY_PATH='pwd'
export LD_LIBRARY_PATH

When I tried this, it caused a "full thread dump" upon calling the
native method.
Any ideas why?

Also, does the blackdown install set a LD_LIBRARY_PATH? or need one?  if

so, where is it located?

Any input is appreciated.
Thanks,
Brett Smith
[EMAIL PROTECTED]


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



Re: Thread in the Linux's JVM

1999-11-09 Thread Brett Smith

The JNI/C code DOES execute in the same thread as the Java thread that
invokes it.  You must consider this in your design.  Also, you can't
have a "non-Java" thread perform a call-back to a Java object.

Brett Smith


 Subject:
Re: Thread in the Linux's JVM
   Date:
Tue, 09 Nov 1999 12:23:35 -0500
   From:
Jacob Nikom <[EMAIL PROTECTED]>
 To:
Nathan Meyers <[EMAIL PROTECTED]>
CC:
Evandro Luquini <[EMAIL PROTECTED]>,
[EMAIL PROTECTED]



So, you think that JNI does not represent any specific issues in
Java multithreading? Does the JNI/C code executes in the same thread
as the Java method which invoked it?

Also, what about event-dispatching thread? In the documentation about
InvokeLater() method there is no any mention that you have to change
the non-event-dispatching thread's priority in order to allow the
event-dispatching thread get called. Is it simply assumed? This is
strange.

Jacob Nikom

Nathan Meyers wrote:
>
> Jacob Nikom wrote:
>
> > It would be nice to know more about multithreading features of Linux

> > JVM.
>
> There are two threading models. If you run with green threads, there
is
> no preemption, and control passes between threads either with yield()
> calls or possibly with other calls that can block (such as sleep() and

> various I/O calls).
>
> If you run with native threads, the JVM is using the system's pthread
> API, which (except for very strangely configured systems) means it's
> using kernel threads. They give you preemption but not thread
> priorities, and there is no guarantee about the size of the time
slices,
> when preemption occurs, or how thread execution is distributed across
> multiple processors.
>
> It sounds from your description like you're relying on preemption.
> Unfortunately, that's a bad thing - Java doesn't guarantee that you'll

> get it, and you need to code as if preemption will not happen.
> SwingWorker is a nice tool for conveniently launching another thread,
> but it doesn't magically turn non-preemptive threads into preemptive
> threads.
>
> So to your problem... why did the behavior change when you rewrote
some
> of your Java methods as native methods? My guess is that you were
using
> some Java methods that do voluntary yields, and you stopped using them

> when you rewrote the code as native methods.
>
> BTW, that Sun article mentioned in Evandro's original mail (below)
> discusses why Solaris is a good platform for applications that rely on

> preemptive multi-threading. But it's a Solaris marketing article, not
a
> Java programming guide. The Java portability message is very clear:
> don't rely on preemption.
>
> Nathan
>
> >
> > Hi,
> >
> > Thank you for bringing up this question. I also have problems with
> > multiple threads in Linux. In my case the behavior of threads with
> > JNI is different from pure Java behavior.
> >
> > I use SwingWorker class. If I don't have JNI methods I don't have
> > to use yield() method. If I replace my Java methods with JNI calls
> > I must use yield(), otherwise the application simply does not work.
> > There is no mentioning of yield() method in any SwingWorker-related
> > documentation.
> >
> > It would be nice to know more about multithreading features of Linux

> > JVM.
> >
> > Jacob Nikom
> >
> > > Evandro Luquini wrote:
> > >
> > > Hi,
> > > In the JavaWord article called "programming Java threads in the
real
> > > world, Part 1(
> > > http://www.javaworld.com/jw-09-1998/jw-09-threads.html)", the
author
> > > sad that "Java's promise of platform independence falls flat on
its
> > > face in the threads arena". If you read this paper you will can
see
> > > two plataform example : NT and Solaris.
> > >
> > > Major question is what scheduling is implemented by the Linux JVM
and
> > > the Linux OS. Does it use a nonpreemptive our preemptive scheduler
?
> > >
> > > The other important question is about what thread's architecture
is
> > > implement by Linux O.S. I am asking it because in the sun's paper
> > > "Multithreading: General And Java-Specific Information
> > >
(http://www.sun.com/solaris/java/wp-java/4.html;$sessionid$5CBVN2YAAI4VTAMW0JZE3NUBS1JHEUDO)"

> > > sad : "Understanding the architectural advantages of one native MT

> > > environment/architecture over another is critical to an
understanding
> > > of the advantages of one Java implementation over another. Since a

> > > typical JVM runtime is implemented on top of the traditional
platform,
> > > a richer, architecturally superior MT platform will obviously
> > > translate to a superior Java MT environment for Java applications
on
> > > that platform. The native OS threads model greatly influences Java

> > > application performance."
> > >
> > > Thanks
> >





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



Java/JNI/System calls

2000-05-15 Thread Brett Smith

I am working on an app that controls a special hardware card.  The card
is accessed across the PCI bus and it has several configuration
registers, etc., that I need to control.  I would like to keep most of
the smarts in the Java code (resource usage, etc. coded in the Java
classes that model the hardware).  I plan to use native threads.

We will have a driver (Linux module) installed for our special hardware,
that can give access to read/write and other special funcs (via ioctl).
I have 2 questions regarding this impl.

1) If I use native threads, does each thread need to perform an "open"
before it can call ioctl, or can I cache the fd in the native code?
(different processes can't share fd's, can they?)

2) What about mmap?  Does each thread need is own call?

any other helpful hints or suggestions would be welcome.
thanks,
[EMAIL PROTECTED]



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




javatoidl

2000-07-19 Thread Brett Smith

Is there a version of javatoidl (1.2.2) available for Linux?

thanks,
[EMAIL PROTECTED]





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




idltojava

2000-07-21 Thread Brett Smith

I tried to ask this question yesterday, but apparently was suffering
from some form of dyslexia (javatoidl).

Here is my 2nd attempt:  Is there a version of idltojava for Linux?  I
am using 1.2.2, rc4.

thanks,
[EMAIL PROTECTED]



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




Plug-In

2000-07-25 Thread Brett Smith

Sorry about the off-topic question, but I am looking for a good mailing
list/new group reguarding the following:

We are using the Java 1.2 Plug-In and are experiencing intermittent
crashes (in MS Internet Explorer).  Does anybody know of a good mailing
list for these type of problems?

thanks,
[EMAIL PROTECTED]





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




rmid, http start-up on linux

2000-10-13 Thread Brett Smith

We are running Reggie (via rmid) and the corresponding http servers on a
linux machine.  We want these started automatically as the system
boots.  Attempts to launch rmid from init.rc fails with "execvp: no such
file or directory".

Does anyone know the best place to start rmid and the http servers (we
are using the http that comes with JDK)?  We are using Red Hat 6.2
linux.

thanks for any help
[EMAIL PROTECTED]





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




looking for a kernel mailing list

2000-10-27 Thread Brett Smith

I have a question that would be appropriate for a Linux Kernel list.
Does anyone know of a good one?

We have written a driver for our proprietary h/w.  The driver handles a
multitude of interrupts.  The bottom half routine calls the
corresponding "Interrupt Handler" (static void interruptHandler(void)).
I want to be able to dynamically install one of these "Interrupt
Handlers".  I want to be able to pass the "Interrupt Handler" in from
user code (after the driver has already been loaded), maybe via an IOCTL
call.

Is this possible?  Are 2 builds required, one for the "Interrupt
Handler" and one for the user code that installs it;  Or, can they be
built together (#define MODULE).

thanks for any help,


[EMAIL PROTECTED]





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