A Multi-Threaded Approach to Using Asynchronous C Libraries with Java']Java

被引:1
|
作者
Gates, John [1 ]
Deich, William [1 ]
机构
[1] Univ Calif Santa Cruz, UCO Lick Observ, Santa Cruz, CA 95064 USA
来源
SOFTWARE AND CYBERINFRASTRUCTURE FOR ASTRONOMY III | 2014年 / 9152卷
关键词
!text type='Java']Java[!/text; C; C plus; Multithreading; !text type='Java']Java[!/text] Native Access; !text type='Java']Java[!/text] Native Interface; Keck Task Language;
D O I
10.1117/12.2055203
中图分类号
P1 [天文学];
学科分类号
0704 ;
摘要
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.
引用
收藏
页数:11
相关论文
共 50 条
  • [1] On testing multi-threaded Java']Java programs
    Gong, Xufang
    Wang, Yanchen
    Zhou, Ying
    Li, Bixin
    SNPD 2007: EIGHTH ACIS INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, ARTIFICIAL INTELLIGENCE, NETWORKING, AND PARALLEL/DISTRIBUTED COMPUTING, VOL 1, PROCEEDINGS, 2007, : 702 - +
  • [2] MuTT: a Multi-Threaded Tracer for Java']Java Programs
    Liu, Dapeng
    Xu, Shaochun
    PROCEEDINGS OF THE 8TH IEEE/ACIS INTERNATIONAL CONFERENCE ON COMPUTER AND INFORMATION SCIENCE, 2009, : 949 - +
  • [3] A scalable architecture for multi-threaded JAVA']JAVA applications
    Mrva, M
    Buchenrieder, K
    Kress, R
    DESIGN, AUTOMATION AND TEST IN EUROPE, PROCEEDINGS, 1998, : 868 - 874
  • [4] Safe locking for multi-threaded Java']Java with exceptions
    Johnsen, Einar Broch
    Thi Mai Thuong Tran
    Owe, Olaf
    Steffen, Martin
    JOURNAL OF LOGIC AND ALGEBRAIC PROGRAMMING, 2012, 81 (03): : 257 - 283
  • [5] Verifying a compiler optimization for multi-threaded Java']Java
    Reus, B
    Knapp, A
    Cenciarelli, P
    Wirsing, M
    RECENT TRENDS IN ALGEBRAIC DEVELOPMENT TECHNIQUES, 1998, 1376 : 402 - 417
  • [6] Framework for testing multi-threaded Java']Java programs
    Edelstein, O
    Farchi, E
    Goldin, E
    Nir, Y
    Ratsaby, G
    Ur, S
    CONCURRENCY AND COMPUTATION-PRACTICE & EXPERIENCE, 2003, 15 (3-5): : 485 - 499
  • [7] Implementation of strong mobility for multi-threaded agents in Java']Java
    Chakravarti, AJ
    Wang, XJ
    Hallstrom, JO
    Baumgartner, G
    2003 INTERNATIONAL CONFERENCE ON PARALLEL PROCESSING, PROCEEDINGS, 2003, : 321 - 330
  • [8] Proposal of a Testing Method Using Similarity of Interleaving for Java']Java Multi-threaded Programs
    Katayama, Tetsuro
    Kitano, Shoichiro
    Kita, Yoshihiro
    Yamaba, Hisaaki
    Aburada, Kentaro
    Okazaki, Naonobu
    JOURNAL OF ROBOTICS NETWORKING AND ARTIFICIAL LIFE, 2015, 1 (04): : 299 - 302
  • [9] MULTI-THREADED DATA COMMUNICATION IN JAVA']JAVA FOR ADVANCED COMPUTING ENVIRONMENTS
    Wang, Jinying
    Yang, Jing
    SCALABLE COMPUTING-PRACTICE AND EXPERIENCE, 2023, 24 (04): : 1087 - 1096
  • [10] Proposal of a Testing Method Using Similarity of Interleaving for Java']Java Multi-threaded Programs
    Kitano, Shoichiro
    Katayama, Tetsuro
    Kita, Yoshihiro
    Yamaba, Hisaaki
    Aburada, Kentaro
    Okazaki, Naonobu
    PROCEEDINGS OF INTERNATIONAL CONFERENCE ON ARTIFICIAL LIFE AND ROBOTICS (ICAROB2015), 2015, : 380 - 383