NobleBlocks

From the research index

The paper comes from the research index. It wasn’t submitted here.

Journal article

A multi-threaded approach to using asynchronous C libraries with Java

John M. Gates, William Deich

Proceedings of SPIE, the International Society for Optical Engineering/Proceedings of SPIE18 Jul 2014

Abstract

No PDF here

The full text is at the publisher

You can read the abstract here, or open it at the publisher.

Read at the publisher

It is very common to write device drivers and code that access low level operation system functions in C or C+ +. There are also many powerful C and C++ libraries available for a variety of tasks. Java is a programming language that is meant to be system independent and is arguably much simpler to code than C/C++. However, Java has minimal support for talking to native libraries, which results in interesting challenges when using C/C++ libraries with Java code. Part of the problem is that Java's standard mechanism for communicating with C libraries, Java Native Interface, requires a significant amount of effort to do fairly simple things, such as copy structure data from C to a class in Java. This is largely solved by using the Java Native Access Library, which provides a reasonable way of transferring data between C structures and Java classes and calling C functions from Java. A more serious issue is that there is no mechanism for a C/C++ library loaded by a Java program to call a Java function in the Java program, as this is a major issue with any library that uses callback functions. A solution to this problem was found using a moderate amount of C code and multiple threads in Java. The Keck Task Language API (KTL) is used as a primary means of inter-process communication at Keck and Lick Observatory. KTL is implemented in a series or C libraries and uses callback functions for asynchronous communication. It is a good demonstration of how to use a C library within a Java program.

Identifiers

Discussion

Citations

2References

Topics

Details

Published
18 Jul 2014
Publisher
SPIE
Issue
Volume 9152 · Pages 91522Y–91522Y
ISSN
0277-786X
Language
EN

More

Suggest a correction or report