Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[JNI] Need fast way to access native array


  • From: pdm@xxxxxxx (Paul Mclachlan)
  • Subject: [JNI] Need fast way to access native array
  • Date: Wed, 27 Dec 2000 13:28:50 -0500

At 10:28 12 Dec 2000 -0600, Bill Tschumy wrote:

> I am working on some Java code that needs to gain quick access to a 
> native C array.  The native code is generating the array which 
> represents an animated image.  The Java code needs to access this 
> code to display it on screen.
> 
> I have tried using the JNI call SetIntArrayArrayRegion(...) to copy 
> the bits to a Java int array, but this is painfully slow.  The image 
> is a full screen display and the copying it takes around 1 to 2 
> seconds.  I ideally need to display around 5-10 fps.
> 
> I know I've seen various Java based 3-D animation packages that use 
> native code for their rendering.   They seem to be getting much 
> better throughput.  Is there some other API call I should be using?

I haven't used it, but I understand there is a concept of 'pinning' in JNI,
that allows you to lock a java array in memory and update it using native code.
I don't know if it would work in your precise situation, but I'd definately
look into it.

Paul

-- 
Paul Mclachlan (paul.mclachlan@xxxxxxxxxx)
Software Engineer, Java Tools.  NuMega Lab, Compuware corp.

---
To unsubscribe, mail advanced-java-unsubscribe@xxxxxxxxxxxxxxxx
To get help, mail advanced-java-help@xxxxxxxxxxxxxxxx