Porting Guide - Moving Java applications to 64-bit systems. 64-bit Java - general considerations

Size: px
Start display at page:

Download "Porting Guide - Moving Java applications to 64-bit systems. 64-bit Java - general considerations"

Transcription

1 Porting Guide - Moving Java applications to 64-bit systems IBM has produced versions of the Java TM Developer Kit and Java Runtime Environment that run in true 64-bit mode on 64-bit systems including IBM Power, IBM zseries and Itanium. This document is intended for programmers and it describes the process of porting Java applications that run on 32-bit systems to 64-bit systems. This document covers: General porting considerations Porting native code from 32-bit to 64-bit JNI considerations Usage of the JNI Interface JVMPI and JVMDI interfaces 64-bit Java - general considerations This section considers some of the issues involved in implementing Java as a true 64-bit process on a processor and operating system combination that offers an execution mode with 64-bit addressing, where address pointers are 64-bits and where accessible memory can be greater than 4GB. The IBM implementation of the Java platform on 64-bit processors IBM provides 64-bit implementations of the Java platform on a number of 64-bit platforms. Why is there a need for 64-bit versions of the Java technology? The size of the addresses on the underlying processor or operating system is not visible or relevant to Java applications, because the Java language and the Java environment do not have explicit pointers that reference memory locations. So you might think that a 64- bit implementation of Java is not necessary. One reason for having a 64-bit Java implementation is that the Java environment must be able to run within the context of a 64-bit system and Java must be able to exploit the capabilities of the system. There are Java programs that have to run within the process of a 64-bit application or subsystem. An example of this occurs where a Stored Procedure is implemented using the Java platform within a database such as IBM s DB2. There might also be the need for a Java application to use native code through Java Native Interface (JNI) where the Native Code is 64-bit. An example of this is a Java application that uses a Java Database Connectivity (JDBC) driver that is written in 64-bit native code on a 64-bit platform. A third reason is the need for a Java application to exploit the large amounts of data possible for large memory systems. The Java heap space (where all Java objects are held at runtime) must be greater than the 4GB maximum size possible on a 32-bit system for this to be possible. To satisfy each of these cases, it is necessary for the Java Runtime Environment to be implemented as a true 64- bit process on a 64-bit system. The Java API and porting native code The way that Java applications run on a 64-bit Java implementation is shown in Figure 1. This diagram is helpful in identifying significant components and it helps you to understand which items need to change when porting applications from 32-bit to 64-bit. All Java applications are written to a defined Java application

2 programming interface (API). This API is the same for all Java 2 Standard Edition (J2SE) implementations, whether they are 32-bit or 64-bit. Java Application Code API awt net lang rmi Java Class Libraries 64-bit Java VM Native Code JIT Heap HPI Layer JNI JVMPI JVMDI 64-Bit Process Operating System Figure 1. Java Applications running on a 64-bit System The Java API includes the various Java class libraries (for example, awt, swing, net, io, and rmi) that are supplied as a fundamental part of Java 2 SE. The Java API - and all of the Java code - is exactly the same on a 64-bit implementation as it is on a 32-bit implementation. It is this characteristic of the Java code that enables it to deliver the promise of write once, run anywhere. In other words, if you have Java program code that runs on a 32-bit Java system, it runs unchanged on a 64-bit system. If your Java application is written 100% in the Java language, porting from 32-bit to 64-bit systems is very simple. Your 100% Java application will run unchanged - it will not even require to be recompiled.

3 Many Java applications are not written 100% in the Java language. For these applications, some of their code is written in a non-java language, such as C or C++, which is generally referred to as native code. Porting Java applications that have native code takes more effort. All the Java code (the application and the class libraries) is executed by the Java Virtual Machine (Java VM). The Java VM contains subcomponents that run the Java code and manage the data in the Java Heap. The IBM version of the Java VM includes a state-of-the-art just-in-time compiler (JIT) that compiles the Java code into native processor instructions before execution. In this way, the JIT maximises the performance of the code. In a 64-bit implementation of the Java environment, it is the Java VM that is implemented as a 64-bit program and that is aware of the 64-bit nature of the underlying processor. This includes the JIT compiler, which must compile the Java code to use 64-bit addresses. The JIT compiler is also aware of the full 64-bit instruction set available on the underlying processor. In IBM s implementation of J2SE, the Java VM communicates with the operating system through the Host Porting Interface (HPI). This communication makes the Java VM code independent of the underlying operating system and allows the IBM implementation of J2SE to support a range of operating systems on a given processor type. IBM implementations of J2SE Version and later are available in 64-bit mode for the following combinations of processor and operating system: Processor Type IBM Power series IBM zseries Intel Itanium series Operating Systems supported AIX, Linux Linux Microsoft Windows, Linux JNI and native code The Java VM, the HPI layer, and the Java code all execute within a single 64-bit operating system process. Normally, there is some native code that executes within that same process. The native code is one or more libraries of code compiled directly for the processor and operating system. The native code is accessed from Java code through the Java Native Interface (JNI). The native code can also access Java objects and methods through the JNI. Some native code is part of the J2SE implementation, such as the code that implements the Java awt classes using the graphics and windowing functions provided by the operating system. Other native code may be provided as part of an application. There are two other interfaces which are similar in nature to the JNI: the Java Virtual Machine Profiling Interface (JVMPI) and the Java Virtual Machine Debugging Interface (JVMDI). These interfaces provide capabilities for the Profiling and Debugging of Java applications. To use these capabilities, you must write some native code. In the case of the 64-bit implementations of J2SE, all the native code associated with the 64-bit Java VM must be 64-bit, because it all runs in the same process space as the JVM. It is not possible to run 64-bit code and 32- bit code within the same process space because of the incompatibility of the address sizes between these two types of code. Native code, typically written in the C or C++ languages, is directly aware of the size of addresses. If your application has native code, the native code must be ported from a 32-bit system to a 64-bit system. Native code must be recompiled and relinked for the 64-bit system. Native code needs to be modified to

4 work correctly with 64-bit addresses and other related differences between 32-bit and 64-bit environments. In summary, the 64-bit Java VM implementation runs on a 64-bit processor and links to code that is also 64-bit aware. The Java VM is also able to use the large memory support and 64-bit instructions of the underlying processor. The Java applications it runs are exactly the same as those that can run on 32-bit implementations of Java. Only native code must be ported from 32-bit systems to 64-bit systems. The advantage of Java programs when moving from 32-bit to 64-bit The Java language and environment make the transition from 32-bit computing to 64-bit computing particularly straightforward. For programs written in languages that have explicit address pointers, such as C and C++, porting an application from 32-bit to 64-bit can take considerable effort. This is because every pointer must be redeclared as a 64-bit quantity and any calculation concerning addresses must be checked carefully and adjusted to ensure that it executes correctly in the 64-bit environment. By contrast, Java programs do not even require to be recompiled in order to run correctly in the 64-bit environment. For Java programs, all the hard work is done by the Java VM implementation. The underlying pointer size is hidden from view. Porting native code from 32-bit to 64-bit Where a Java application has native code, the main task in porting the native code from a 32-bit system to a 64- bit system involves making the native code work correctly in the 64-bit environment. A second task involves the changes needed in the native code to work with the 64-bit versions of the JNI, JVMPI, and JVMDI, where there are a few subtle changes. You should consult the documentation relating to your operating system platform and to your C/C++ Compiler on the changes needed to port code from 32-bit to 64-bit, but here is a summary of the changes for Windows, Linux and AIX: v For Windows, on 32-bit systems, integers, longs and pointers are all 32-bits. On 64-bit systems, integers and longs remain 32-bits, but pointers become 64-bits and long longs are 64-bits. v For AIX and Linux, on 32-bit systems, integers, longs and pointers are all 32-bits. On 64-bit systems, integers remain 32-bits and longs and pointers become 64-bits. All native code must be adjusted to work with these differences introduced by the 64-bit systems. The best way to do this is to make changes that allow a single copy of the source code to be compiled either for a 32-bit target system or for a 64-bit target system. Although there is no one best way to achieve this goal, a good way to achieve this is to use abstract types for any integers that need to be of the same size as a pointer. For example, when making address calculations, the abstract integer types map either to 32-bits or to 64-bits depending on the size of a pointer. On Unix systems (AIX or Linux), care must be taken with the use of long types. The best advice is to avoid the use of long integers because they are known to change size between 32-bit systems and 64-bit systems. Another important consideration when porting native code to 64-bit systems is that data types must be correctly aligned. Incorrect alignment can cause serious loss of code performance. Correct alignment for the various data types is as follows: AIX, Linux 32-bit AIX, Linux 64-bit Windows 32-bit Windows 64-bit

5 C/C++ Data Types Size/Alignment Size/Alignment Size/Alignment Size/Alignment char 1/1 1/1 1/1 1/1 short 2/2 2/2 2/2 2/2 int 4/4 4/4 4/4 4/4 long 4/4 8/8 4/4 4/4 long long 8/8 8/8 8/8 8/8 pointer 4/4 8/8 4/4 8/8 float 4/4 4/4 4/4 4/4 double 8/4 8/4 8/8 8/8 long double 16/16 16/16 8/8 8/8 When the native code has been adjusted to take account of the differences between 32-bit systems and 64-bit systems, you must tune the code to accommodate differences in the interfaces to the Java VM - the JNI, the JVMDI and the JVMPI. JNI considerations The main consideration in using JNI from native code on a 64-bit system is that length-related quantities in JNI are defined as 64-bits. This is true even though the underlying objects and quantities within the Java Developer Kit (JDK) are restricted to values no greater than 32-bits. An error occurs if native code uses values greater than 32 bits for these quantities. The definition of JNI is held in two header files, which are included by any native code using JNI - jni.h and jni_md.h. In a 64-bit version of the JDK, the JNI interface itself changes as follows: v All pointers (foo *) become 64-bit. v <jni_md.h> jint This is defined as a 32-bit value (int), since on Unix systems a long is a 64-bit integer. v <jni.h> jsize. This type is used extensively for quantities that imply lengths. This is changed on 64-bit systems to a jlong so that it is 64-bits, in contrast to the definition on 32-bit platforms where it is a jint, which is 32-bits. v jfloat and jdouble values remain the same as in 32-bit systems. v a jobject is defined as a pointer and so is clearly 64-bit.. v jclass, jthrowable, jstring and jarray are all declared as jobjects and are all 64-bit. v jvalue is a union of all basic 'j' types and is already 64-bit. v jmethodid and jfieldid are declared as pointer types and are 64-bit quantities. v JNINativeMethod struct is 3 pointers and becomes 24 bytes. v JNIEnv is declared as a pointer type and is 64-bit. v JavaVM is declared as a pointer type and is 64-bit. v JNINativeInterface is declared as an array of pointers and these are all 64-bit. v DefineClass has a buffer parameter with an associated size parameter. The size parameter is declared as a jsize and therefore is a 64-bit integer length. However, class objects cannot be this large, so there is an upper bound to the value of the size parameter and is less than 32-bits. v PushLocalFrame has a capacity defined by a jint and is limited to 32-bits.

6 v EnsureLocalCapacity has a capacity defined by a jint and is limited to 32-bits. v NewString has a jsize length parameter and becomes 64-bit. However, the size of the supplied unicode string has a maximum length no greater than a 32-bit integer. v GetStringLength returns a jsize, which is 64-bit. The length of a Java string is limited to 32-bit integer values. v GetStringUTFLength returns a jsize, which is 64-bit. The length of a Java string is limited to 32-bit integer values. v GetArrayLength returns a jsize, which is 64-bit. However, Java arrays cannot have a length greater than a 32-bit integer value. v NewxxxArray (eg NewBooleanArray) all have jsize length parameters, which are 64-bit. Java arrays cannot have a length greater than a 32-bit integer value. v GetObjectArrayElement, SetObjectArrayElement both have jsize index values which are 64-bit. Java arrays cannot have a length greater than a 32-bit integer. v GetxxxArrayRegion, SetxxxArrayRegion all have jsize start and length fields, which are 64-bit. (xxx here stands for the various types of primitives such as int or float) Java arrays cannot have a length greater than 32- bit integer value. v RegisterNatives has a jint parameter - number of methods. v GetStringRegion, GetStringUTFRegion both have start and length parameters as jsize, which are 64-bit. Strings are limited to 32-bit lengths. v JavaVMOption struct has two pointers: both become 64-bit. v JavaVMInitArgs struct: alignment is affected by change to JavaVMOption struct. v JavaVMAttachArgs alignment is affected by two pointers. Usage of JNI Interface Beyond the form of the JNI interface, you must consider how the JNI is used by native libraries on a 64-bit system. The issues are as follows: On some 64-bit systems, certain native objects that are passed across the JNI are 64-bit, whereas they are 32- bit on equivalent 32-bit systems. Examples of this type of object are Socket handles and File handles. v Passing the 64-bit items across the JNI is not a problem. However, in many cases, these items are stored into Java object fields. The implication is that the type of these object fields must change on a 64-bit platform compared with existing 32-bit platforms. You will have to change parts of the Java code to achieve this. v If the size of a Java object field is different on the 64-bit platform from the 32-bit platform, any native code that is working with that object field must be changed to reflect this when the code is ported from 32-bit to 64- bit. You can best deal with this issue by having a proper description of each of the Java object types that is affected in this way. If your application code stores native data within Java objects, then you need to modify your Java code to ensure that there is sufficient space within your Java objects to store the full size of the native data.

7 JVMPI and JVMDI interfaces Applications may have native code that uses the JVMPI and JVMDI interfaces. These interfaces are also affected by the change from 32-bit to 64-bit as described in this section. JVMPI interface The JVMPI interface is defined in the header file jvmpi.h. The following changes have been made to the interface definition: 1. struct { unsigned char *class_data; /* content of class file */ jint class_data_len; unsigned char *new_class_data; /* class file length */ /* instrumented class file */ jint new_class_data_len; /* new class file length */ void * (*malloc_f)(size_t); } class_load_hook; /* memory allocation function */ This definition is the same as the definition on IBM 32-bit Java implementations. However, it differs from the Sun specification in relation to the definition of the memory allocation function. Defining the memory allocation function with a size_t type parameter actually enables this structure to work unchanged on 64-bit systems, because size_t becomes 64 bits. 2. struct { jint arena_id; jobjectid class_id; /* id of object class */ jint is_array; /* JVMPI_NORMAL_OBJECT,... */ jsize size; /* size in number of bytes */ jobjectid obj_id; /* id assigned to this object */ } obj_alloc; Here, the size field becomes jsize in type, which is 64 bits on 64-bit systems, but 32 bits on 32-bit systems. 3. struct { jsize data_len; char *data; } object_dump; Here, the data_len field becomes jsize in type, which is 64 bits on 64-bit systems, but 32 bits on 32-bit systems. Remember that the JVMPI interface is a flexible interface that is typically extended beyond the basic set of function. This is true for IBM 64-bit Java implementations as well as for the IBM 32-bit Java implementations. JVMDI interface The JVMDI interface is defined in the header file jvmdi.h. The JVMDI Interface has no changes for 64-bit, other than changing Pointer parameters to 64-bit from 32-bit. All JVMDI structures and function call definitions remain the same in 64-bit as they are in 32-bit.

8 Trademarks Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both. IBM is a registered trademark of IBM Corporation. AIX is a trademark of IBM Corporation.

NDK Integration (JNI)

NDK Integration (JNI) NDK Integration (JNI) Lecture 6 Operating Systems Practical 9 November 2016 This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit

More information

We can also throw Java exceptions in the native code.

We can also throw Java exceptions in the native code. 4. 5. 6. 7. Java arrays are handled by JNI as reference types. We have two types of arrays: primitive and object arrays. They are treated differently by JNI. Primitive arrays contain primitive data types

More information

Lecture 5 - NDK Integration (JNI)

Lecture 5 - NDK Integration (JNI) Lecture 5 - NDK Integration (JNI) This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/

More information

Lecture 6 - NDK Integration (JNI)

Lecture 6 - NDK Integration (JNI) Lecture 6 - NDK Integration (JNI) This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/

More information

Calling C Function from the Java Code Calling Java Method from C/C++ Code

Calling C Function from the Java Code Calling Java Method from C/C++ Code Java Native Interface: JNI Calling C Function from the Java Code Calling Java Method from C/C++ Code Calling C Functions From Java Print Hello Native World HelloNativeTest (Java) HelloNative.c HelloNative.h

More information

JAVA Native Interface

JAVA Native Interface CSC 308 2.0 System Development with Java JAVA Native Interface Department of Statistics and Computer Science Java Native Interface Is a programming framework JNI functions written in a language other than

More information

Study on Programming by Combining Java with C++ Based on JNI

Study on Programming by Combining Java with C++ Based on JNI doi: 10.14355/spr.2016.05.003 Study on Programming by Combining Java with C++ Based on JNI Tan Qingquan 1, Luo Huachun* 2, Jiang Lianyan 3, Bo Tao 4, Liu Qun 5, Liu Bo 6 Earthquake Administration of Beijing

More information

Java TM Native Methods. Rex Jaeschke

Java TM Native Methods. Rex Jaeschke Java TM Native Methods Rex Jaeschke Java Native Methods 1999, 2007, 2009 Rex Jaeschke. All rights reserved. Edition: 2.0 (matches JDK1.6/Java 2) All rights reserved. No part of this publication may be

More information

Selected Java Topics

Selected Java Topics Selected Java Topics Introduction Basic Types, Objects and Pointers Modifiers Abstract Classes and Interfaces Exceptions and Runtime Exceptions Static Variables and Static Methods Type Safe Constants Swings

More information

Chapter 1 GETTING STARTED. SYS-ED/ Computer Education Techniques, Inc.

Chapter 1 GETTING STARTED. SYS-ED/ Computer Education Techniques, Inc. Chapter 1 GETTING STARTED SYS-ED/ Computer Education Techniques, Inc. Objectives You will learn: Java platform. Applets and applications. Java programming language: facilities and foundation. Memory management

More information

Outline. Introduction to Java. What Is Java? History. Java 2 Platform. Java 2 Platform Standard Edition. Introduction Java 2 Platform

Outline. Introduction to Java. What Is Java? History. Java 2 Platform. Java 2 Platform Standard Edition. Introduction Java 2 Platform Outline Introduction to Java Introduction Java 2 Platform CS 3300 Object-Oriented Concepts Introduction to Java 2 What Is Java? History Characteristics of Java History James Gosling at Sun Microsystems

More information

Java/JMDL communication with MDL applications

Java/JMDL communication with MDL applications m with MDL applications By Stanislav Sumbera [Editor Note: The arrival of MicroStation V8 and its support for Microsoft Visual Basic for Applications opens an entirely new set of duallanguage m issues

More information

Invoking Native Applications from Java

Invoking Native Applications from Java 2012 Marty Hall Invoking Native Applications from Java Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/java.html Customized Java EE Training: http://courses.coreservlets.com/

More information

Lecture 1: Overview of Java

Lecture 1: Overview of Java Lecture 1: Overview of Java What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed for easy Web/Internet applications Widespread

More information

Java Native Interface. Diego Rodrigo Cabral Silva

Java Native Interface. Diego Rodrigo Cabral Silva Java Native Interface Diego Rodrigo Cabral Silva Overview The JNI allows Java code that runs within a Java Virtual Machine (VM) to operate with applications and libraries written in other languages, such

More information

History Introduction to Java Characteristics of Java Data types

History Introduction to Java Characteristics of Java Data types Course Name: Advanced Java Lecture 1 Topics to be covered History Introduction to Java Characteristics of Java Data types What is Java? An Object-Oriented Programming Language developed at Sun Microsystems

More information

Advanced Object-Oriented Programming Introduction to OOP and Java

Advanced Object-Oriented Programming Introduction to OOP and Java Advanced Object-Oriented Programming Introduction to OOP and Java Dr. Kulwadee Somboonviwat International College, KMITL kskulwad@kmitl.ac.th Course Objectives Solidify object-oriented programming skills

More information

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview Introduction to Visual Basic and Visual C++ Introduction to Java Lesson 13 Overview I154-1-A A @ Peter Lo 2010 1 I154-1-A A @ Peter Lo 2010 2 Overview JDK Editions Before you can write and run the simple

More information

Distributed Systems 8. Remote Procedure Calls

Distributed Systems 8. Remote Procedure Calls Distributed Systems 8. Remote Procedure Calls Paul Krzyzanowski pxk@cs.rutgers.edu 10/1/2012 1 Problems with the sockets API The sockets interface forces a read/write mechanism Programming is often easier

More information

Inlining Java Native Calls at Runtime

Inlining Java Native Calls at Runtime Inlining Java Native Calls at Runtime (CASCON 2005 4 th Workshop on Compiler Driven Performance) Levon Stepanian, Angela Demke Brown Computer Systems Group Department of Computer Science, University of

More information

Distributed Systems. How do regular procedure calls work in programming languages? Problems with sockets RPC. Regular procedure calls

Distributed Systems. How do regular procedure calls work in programming languages? Problems with sockets RPC. Regular procedure calls Problems with sockets Distributed Systems Sockets interface is straightforward [connect] read/write [disconnect] Remote Procedure Calls BUT it forces read/write mechanism We usually use a procedure call

More information

SUB CODE:IT0407 SUB NAME:INTEGRATIVE PROGRAMMING & TECHNOLOGIES SEM : VII. N.J.Subashini Assistant Professor,(Sr. G) SRM University, Kattankulathur

SUB CODE:IT0407 SUB NAME:INTEGRATIVE PROGRAMMING & TECHNOLOGIES SEM : VII. N.J.Subashini Assistant Professor,(Sr. G) SRM University, Kattankulathur SUB CODE:IT0407 SUB NAME:INTEGRATIVE PROGRAMMING & TECHNOLOGIES SEM : VII N.J.Subashini Assistant Professor,(Sr. G) SRM University, Kattankulathur 1 UNIT I 2 UNIT 1 LANGUAGE INTEROPERABILITY IN JAVA 9

More information

Operating Systems. 18. Remote Procedure Calls. Paul Krzyzanowski. Rutgers University. Spring /20/ Paul Krzyzanowski

Operating Systems. 18. Remote Procedure Calls. Paul Krzyzanowski. Rutgers University. Spring /20/ Paul Krzyzanowski Operating Systems 18. Remote Procedure Calls Paul Krzyzanowski Rutgers University Spring 2015 4/20/2015 2014-2015 Paul Krzyzanowski 1 Remote Procedure Calls 2 Problems with the sockets API The sockets

More information

Data Types. Every program uses data, either explicitly or implicitly to arrive at a result.

Data Types. Every program uses data, either explicitly or implicitly to arrive at a result. Every program uses data, either explicitly or implicitly to arrive at a result. Data in a program is collected into data structures, and is manipulated by algorithms. Algorithms + Data Structures = Programs

More information

EMBEDDED SYSTEMS PROGRAMMING Android NDK

EMBEDDED SYSTEMS PROGRAMMING Android NDK EMBEDDED SYSTEMS PROGRAMMING 2014-15 Android NDK WHAT IS THE NDK? The Android NDK is a set of cross-compilers, scripts and libraries that allows to embed native code into Android applications Native code

More information

Chapter 1 INTRODUCTION SYS-ED/ COMPUTER EDUCATION TECHNIQUES, INC.

Chapter 1 INTRODUCTION SYS-ED/ COMPUTER EDUCATION TECHNIQUES, INC. hapter 1 INTRODUTION SYS-ED/ OMPUTER EDUATION TEHNIQUES, IN. Objectives You will learn: Java features. Java and its associated components. Features of a Java application and applet. Java data types. Java

More information

CS 261 Fall C Introduction. Variables, Memory Model, Pointers, and Debugging. Mike Lam, Professor

CS 261 Fall C Introduction. Variables, Memory Model, Pointers, and Debugging. Mike Lam, Professor CS 261 Fall 2017 Mike Lam, Professor C Introduction Variables, Memory Model, Pointers, and Debugging The C Language Systems language originally developed for Unix Imperative, compiled language with static

More information

Android NDK. Federico Menozzi & Srihari Pratapa

Android NDK. Federico Menozzi & Srihari Pratapa Android NDK Federico Menozzi & Srihari Pratapa Resources C++ CMake https://cmake.org/cmake-tutorial/ http://mathnathan.com/2010/07/getting-started-with-cmake/ NDK http://www.cplusplus.com/doc/tutorial/

More information

CS Programming In C

CS Programming In C CS 24000 - Programming In C Week Two: Basic C Program Organization and Data Types Zhiyuan Li Department of Computer Science Purdue University, USA 2 int main() { } return 0; The Simplest C Program C programs

More information

LEVERAGING EXISTING PLASMA SIMULATION CODES. Anna Malinova, Vasil Yordanov, Jan van Dijk

LEVERAGING EXISTING PLASMA SIMULATION CODES. Anna Malinova, Vasil Yordanov, Jan van Dijk 136 LEVERAGING EXISTING PLASMA SIMULATION CODES Anna Malinova, Vasil Yordanov, Jan van Dijk Abstract: This paper describes the process of wrapping existing scientific codes in the domain of plasma physics

More information

Notes of the course - Advanced Programming. Barbara Russo

Notes of the course - Advanced Programming. Barbara Russo Notes of the course - Advanced Programming Barbara Russo a.y. 2014-2015 Contents 1 Lecture 2 Lecture 2 - Compilation, Interpreting, and debugging........ 2 1.1 Compiling and interpreting...................

More information

Assumptions. History

Assumptions. History Assumptions A Brief Introduction to Java for C++ Programmers: Part 1 ENGI 5895: Software Design Faculty of Engineering & Applied Science Memorial University of Newfoundland You already know C++ You understand

More information

Untyped Memory in the Java Virtual Machine

Untyped Memory in the Java Virtual Machine Untyped Memory in the Java Virtual Machine Andreas Gal and Michael Franz University of California, Irvine {gal,franz}@uci.edu Christian W. Probst Technical University of Denmark probst@imm.dtu.dk July

More information

SmartHeap for Multi-Core

SmartHeap for Multi-Core SmartHeap for Multi-Core Getting Started and Platform Guide for Linux Version 11.2 SmartHeap and HeapAgent are trademarks of Compuware Corporation. All other trademarks are the property of their respective

More information

Short Notes of CS201

Short Notes of CS201 #includes: Short Notes of CS201 The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with < and > if the file is a system

More information

The NetRexx Interpreter

The NetRexx Interpreter The NetRexx Interpreter http://www2.hursley.ibm.com/netrexx/ RexxLA / WarpTech -- 26 May 2000 Mike Cowlishaw IBM Fellow mfc@uk.ibm.com netrexxi Overview Introduction to NetRexx Demo. -- compiling and interpreting

More information

Question. 1 Features of Java.

Question. 1 Features of Java. QUESTIONS BANK (CP-II) No Question 1 Features of Java. QUESTIONS BANK (CP-II) ( Using java) QUESTIONS BANK (CP-II) or Java Features:- (1) Java Is Small and Simple Java is modeled after C and C++. The object-oriented

More information

Lecture 2 summary of Java SE section 1

Lecture 2 summary of Java SE section 1 Lecture 2 summary of Java SE section 1 presentation DAD Distributed Applications Development Cristian Toma D.I.C.E/D.E.I.C Department of Economic Informatics & Cybernetics www.dice.ase.ro Cristian Toma

More information

Java Performance Analysis for Scientific Computing

Java Performance Analysis for Scientific Computing Java Performance Analysis for Scientific Computing Roldan Pozo Leader, Mathematical Software Group National Institute of Standards and Technology USA UKHEC: Java for High End Computing Nov. 20th, 2000

More information

Introduction to Programming (Java) 2/12

Introduction to Programming (Java) 2/12 Introduction to Programming (Java) 2/12 Michal Krátký Department of Computer Science Technical University of Ostrava Introduction to Programming (Java) 2008/2009 c 2006 2008 Michal Krátký Introduction

More information

Programming. Syntax and Semantics

Programming. Syntax and Semantics Programming For the next ten weeks you will learn basic programming principles There is much more to programming than knowing a programming language When programming you need to use a tool, in this case

More information

CS201 - Introduction to Programming Glossary By

CS201 - Introduction to Programming Glossary By CS201 - Introduction to Programming Glossary By #include : The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with

More information

Compiling Techniques

Compiling Techniques Lecture 10: Introduction to 10 November 2015 Coursework: Block and Procedure Table of contents Introduction 1 Introduction Overview Java Virtual Machine Frames and Function Call 2 JVM Types and Mnemonics

More information

COE318 Lecture Notes Week 3 (Week of Sept 17, 2012)

COE318 Lecture Notes Week 3 (Week of Sept 17, 2012) COE318 Lecture Notes: Week 3 1 of 8 COE318 Lecture Notes Week 3 (Week of Sept 17, 2012) Announcements Quiz (5% of total mark) on Wednesday, September 26, 2012. Covers weeks 1 3. This includes both the

More information

a data type is Types

a data type is Types Pointers Class 2 a data type is Types Types a data type is a set of values a set of operations defined on those values in C++ (and most languages) there are two flavors of types primitive or fundamental

More information

Lecture 2: C Programm

Lecture 2: C Programm 0 3 E CS 1 Lecture 2: C Programm ing C Programming Procedural thought process No built in object abstractions data separate from methods/functions Low memory overhead compared to Java No overhead of classes

More information

advanced data types (2) typedef. today advanced data types (3) enum. mon 23 sep 2002 defining your own types using typedef

advanced data types (2) typedef. today advanced data types (3) enum. mon 23 sep 2002 defining your own types using typedef today advanced data types (1) typedef. mon 23 sep 2002 homework #1 due today homework #2 out today quiz #1 next class 30-45 minutes long one page of notes topics: C advanced data types dynamic memory allocation

More information

Midterm CSE 131B Spring 2005

Midterm CSE 131B Spring 2005 Signature Login Name _ Name Student ID Midterm CSE 131B Spring 2005 Page 1 Page 2 Page 3 Page 4 Page 5 (20 points) (18 points) (22 points) (20 points) (20 points) Subtotal Page 6 Extra Credit (100 points)

More information

CS321 Languages and Compiler Design I. Winter 2012 Lecture 2

CS321 Languages and Compiler Design I. Winter 2012 Lecture 2 CS321 Languages and Compiler Design I Winter 2012 Lecture 2 1 A (RE-)INTRODUCTION TO JAVA FOR C++/C PROGRAMMERS Why Java? Developed by Sun Microsystems (now Oracle) beginning in 1995. Conceived as a better,

More information

Introducing the PurifyPlus Family: PurifyPlus for Windows PurifyPlus for UNIX PurifyPlus for Linux PurifyPlus RealTime

Introducing the PurifyPlus Family: PurifyPlus for Windows PurifyPlus for UNIX PurifyPlus for Linux PurifyPlus RealTime Introducing the PurifyPlus Family: PurifyPlus for PurifyPlus for UNIX Product version 2002 Release 2 Document version 1.5 Last revision: November 29, 2002 1 High level overview: A. Intro an introduction

More information

Introduction to C++ Introduction. Structure of a C++ Program. Structure of a C++ Program. C++ widely-used general-purpose programming language

Introduction to C++ Introduction. Structure of a C++ Program. Structure of a C++ Program. C++ widely-used general-purpose programming language Introduction C++ widely-used general-purpose programming language procedural and object-oriented support strong support created by Bjarne Stroustrup starting in 1979 based on C Introduction to C++ also

More information

Windows Java address space

Windows Java address space Windows Java address space This article applies to the IBM 32-bit SDK and Runtime Environment for Windows, Java2 Technology Edition. It explains how the process space for Java is divided and explores a

More information

Question No: 1 ( Marks: 1 ) - Please choose one One difference LISP and PROLOG is. AI Puzzle Game All f the given

Question No: 1 ( Marks: 1 ) - Please choose one One difference LISP and PROLOG is. AI Puzzle Game All f the given MUHAMMAD FAISAL MIT 4 th Semester Al-Barq Campus (VGJW01) Gujranwala faisalgrw123@gmail.com MEGA File Solved MCQ s For Final TERM EXAMS CS508- Modern Programming Languages Question No: 1 ( Marks: 1 ) -

More information

Data Representation and Storage. Some definitions (in C)

Data Representation and Storage. Some definitions (in C) Data Representation and Storage Learning Objectives Define the following terms (with respect to C): Object Declaration Definition Alias Fundamental type Derived type Use pointer arithmetic correctly Explain

More information

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition ELEC / COMP 177 Fall 2012 Some slides from Kurose and Ross, Computer Networking, 5 th Edition Prior experience in programming languages C++ programming? Java programming? C programming? Other languages?

More information

Data Storage. August 9, Indiana University. Geoffrey Brown, Bryce Himebaugh 2015 August 9, / 19

Data Storage. August 9, Indiana University. Geoffrey Brown, Bryce Himebaugh 2015 August 9, / 19 Data Storage Geoffrey Brown Bryce Himebaugh Indiana University August 9, 2016 Geoffrey Brown, Bryce Himebaugh 2015 August 9, 2016 1 / 19 Outline Bits, Bytes, Words Word Size Byte Addressable Memory Byte

More information

Introduction to C++ with content from

Introduction to C++ with content from Introduction to C++ with content from www.cplusplus.com 2 Introduction C++ widely-used general-purpose programming language procedural and object-oriented support strong support created by Bjarne Stroustrup

More information

Compact Off-Heap Structures in the Java Language

Compact Off-Heap Structures in the Java Language Steve Poole May 2013 Compact Off-Heap Structures in the Java Language Important Disclaimers THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY. WHILST EFFORTS WERE

More information

Skip the FFI! Embedding Clang for C Interoperability. Jordan Rose Compiler Engineer, Apple. John McCall Compiler Engineer, Apple

Skip the FFI! Embedding Clang for C Interoperability. Jordan Rose Compiler Engineer, Apple. John McCall Compiler Engineer, Apple Skip the FFI! Embedding Clang for C Interoperability Jordan Rose Compiler Engineer, Apple John McCall Compiler Engineer, Apple Problem Problem Languages don t exist in a vacuum Problem Languages don t

More information

Introduction to Java. Lecture 1 COP 3252 Summer May 16, 2017

Introduction to Java. Lecture 1 COP 3252 Summer May 16, 2017 Introduction to Java Lecture 1 COP 3252 Summer 2017 May 16, 2017 The Java Language Java is a programming language that evolved from C++ Both are object-oriented They both have much of the same syntax Began

More information

Introduction JDBC 4.1. Bok, Jong Soon

Introduction JDBC 4.1. Bok, Jong Soon Introduction JDBC 4.1 Bok, Jong Soon javaexpert@nate.com www.javaexpert.co.kr What is the JDBC TM Stands for Java TM Database Connectivity. Is an API (included in both J2SE and J2EE releases) Provides

More information

StackVsHeap SPL/2010 SPL/20

StackVsHeap SPL/2010 SPL/20 StackVsHeap Objectives Memory management central shared resource in multiprocessing RTE memory models that are used in Java and C++ services for Java/C++ programmer from RTE (JVM / OS). Perspectives of

More information

CPSC 3740 Programming Languages University of Lethbridge. Data Types

CPSC 3740 Programming Languages University of Lethbridge. Data Types Data Types A data type defines a collection of data values and a set of predefined operations on those values Some languages allow user to define additional types Useful for error detection through type

More information

2 rd class Department of Programming. OOP with Java Programming

2 rd class Department of Programming. OOP with Java Programming 1. Structured Programming and Object-Oriented Programming During the 1970s and into the 80s, the primary software engineering methodology was structured programming. The structured programming approach

More information

IA-64 Porting Methodology. An Application Guide

IA-64 Porting Methodology. An Application Guide IA-64 Porting Methodology An Application Guide Table of Contents Introduction.............................................. 3 Methodology Overview................................... 4 1. Select the Programming

More information

Certified Core Java Developer VS-1036

Certified Core Java Developer VS-1036 VS-1036 1. LANGUAGE FUNDAMENTALS The Java language's programming paradigm is implementation and improvement of Object Oriented Programming (OOP) concepts. The Java language has its own rules, syntax, structure

More information

C Introduction. Comparison w/ Java, Memory Model, and Pointers

C Introduction. Comparison w/ Java, Memory Model, and Pointers CS 261 Fall 2018 Mike Lam, Professor C Introduction Comparison w/ Java, Memory Model, and Pointers Please go to socrative.com on your phone or laptop, choose student login and join room LAMJMU The C Language

More information

MODULE 1 JAVA PLATFORMS. Identifying Java Technology Product Groups

MODULE 1 JAVA PLATFORMS. Identifying Java Technology Product Groups MODULE 1 JAVA PLATFORMS Identifying Java Technology Product Groups Java SE Platform Versions Year Developer Version (JDK) Platform 1996 1.0 1 1997 1.1 1 1998 1.2 2 2000 1.3 2 2002 1.4 2 2004 1.5 5 2006

More information

Special Topics: Programming Languages

Special Topics: Programming Languages Lecture #23 0 V22.0490.001 Special Topics: Programming Languages B. Mishra New York University. Lecture # 23 Lecture #23 1 Slide 1 Java: History Spring 1990 April 1991: Naughton, Gosling and Sheridan (

More information

Java: framework overview and in-the-small features

Java: framework overview and in-the-small features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer Java: framework overview and in-the-small features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer

More information

IBM ^ iseries Logical Partition Isolation and Integrity

IBM ^ iseries Logical Partition Isolation and Integrity June 2002 IBM ^ iseries Logical Partition Isolation and Integrity Dave Boutcher IBM Corporation boutcher@us.ibm.com Version 1.0 Page 1 Introduction The purpose of this document is to provide information

More information

Java TM Introduction. Renaud Florquin Isabelle Leclercq. FloConsult SPRL.

Java TM Introduction. Renaud Florquin Isabelle Leclercq. FloConsult SPRL. Java TM Introduction Renaud Florquin Isabelle Leclercq FloConsult SPRL http://www.floconsult.be mailto:info@floconsult.be Java Technical Virtues Write once, run anywhere Get started quickly Write less

More information

Self-assessment Exercise

Self-assessment Exercise 15-410 Self-assessment Exercise About the self-assessment The prerequisite for 15-410, Operating Systems Design & Implementation, is 15-213, Introduction to Computer Systems. The latter is a sort of Computer

More information

JAVA An overview for C++ programmers

JAVA An overview for C++ programmers JAVA An overview for C++ programmers Wagner Truppel wagner@cs.ucr.edu edu March 1st, 2004 The early history James Gosling, Sun Microsystems Not the usual start for a prog.. language Consumer electronics,

More information

PTX WRITER'S GUIDE TO INTEROPERABILITY

PTX WRITER'S GUIDE TO INTEROPERABILITY PTX WRITER'S GUIDE TO INTEROPERABILITY TRM-06721-001_v9.1 April 2018 Reference Guide TABLE OF CONTENTS Chapter 1. Introduction...1 Chapter 2. Data Representation... 2 2.1. Fundamental Types... 2 2.2. Aggregates

More information

Contents. Chapter 1 Overview of the JavaScript C Engine...1. Chapter 2 JavaScript API Reference...23

Contents. Chapter 1 Overview of the JavaScript C Engine...1. Chapter 2 JavaScript API Reference...23 Contents Chapter 1 Overview of the JavaScript C Engine...1 Supported Versions of JavaScript...1 How Do You Use the Engine?...2 How Does the Engine Relate to Applications?...2 Building the Engine...6 What

More information

Data Representation and Storage

Data Representation and Storage Data Representation and Storage Learning Objectives Define the following terms (with respect to C): Object Declaration Definition Alias Fundamental type Derived type Use size_t, ssize_t appropriately Use

More information

JCudaMP: OpenMP/Java on CUDA

JCudaMP: OpenMP/Java on CUDA JCudaMP: OpenMP/Java on CUDA Georg Dotzler, Ronald Veldema, Michael Klemm Programming Systems Group Martensstraße 3 91058 Erlangen Motivation Write once, run anywhere - Java Slogan created by Sun Microsystems

More information

Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson

Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson Introduction History, Characteristics of Java language Java Language Basics Data types, Variables, Operators and Expressions Anatomy of a Java Program

More information

Final Exam. 11 May 2018, 120 minutes, 26 questions, 100 points

Final Exam. 11 May 2018, 120 minutes, 26 questions, 100 points Name: CS520 Final Exam 11 May 2018, 120 minutes, 26 questions, 100 points The exam is closed book and notes. Please keep all electronic devices turned off and out of reach. Note that a question may require

More information

C Programming Review CSC 4320/6320

C Programming Review CSC 4320/6320 C Programming Review CSC 4320/6320 Overview Introduction C program Structure Keywords & C Types Input & Output Arrays Functions Pointers Structures LinkedList Dynamic Memory Allocation Macro Compile &

More information

The New C Standard (Excerpted material)

The New C Standard (Excerpted material) The New C Standard (Excerpted material) An Economic and Cultural Commentary Derek M. Jones derek@knosof.co.uk Copyright 2002-2008 Derek M. Jones. All rights reserved. 39 3.2 3.2 additive operators pointer

More information

Chapter 1: Introduction to Computers and Java

Chapter 1: Introduction to Computers and Java Chapter 1: Introduction to Computers and Java Starting Out with Java: From Control Structures through Objects Fifth Edition by Tony Gaddis Chapter Topics Chapter 1 discusses the following main topics:

More information

8/23/2014. Chapter Topics. Introduction. Java History. Why Program? Java Applications and Applets. Chapter 1: Introduction to Computers and Java

8/23/2014. Chapter Topics. Introduction. Java History. Why Program? Java Applications and Applets. Chapter 1: Introduction to Computers and Java Chapter 1: Introduction to Computers and Java Starting Out with Java: From Control Structures through Objects Fifth Edition by Tony Gaddis Chapter Topics Chapter 1 discusses the following main topics:

More information

QUIZ. What are 3 differences between C and C++ const variables?

QUIZ. What are 3 differences between C and C++ const variables? QUIZ What are 3 differences between C and C++ const variables? Solution QUIZ Source: http://stackoverflow.com/questions/17349387/scope-of-macros-in-c Solution The C/C++ preprocessor substitutes mechanically,

More information

Programming refresher and intro to C programming

Programming refresher and intro to C programming Applied mechatronics Programming refresher and intro to C programming Sven Gestegård Robertz sven.robertz@cs.lth.se Department of Computer Science, Lund University 2018 Outline 1 C programming intro 2

More information

The Impact of a Real-Time JVM on Middleware Performance: Lessons Learned from Implementing DDS on IBM s J9

The Impact of a Real-Time JVM on Middleware Performance: Lessons Learned from Implementing DDS on IBM s J9 The Impact of a Real-Time JVM on Middleware Performance: Lessons Learned from Implementing DDS on IBM s J9 Ken Brophy, Senior Applications Engineer, RTI Rick Warren, Lead Software Engineer, RTI Agenda

More information

Introduction to JAVA Programming Language

Introduction to JAVA Programming Language Introduction to JAVA Programming Language Lecture 2 Based on Slides of Dr. Norazah Yusof 1 Origins of the Java Language Patrick Naughton and Jonathan Payne at Sun Microsystems developed a Web browser that

More information

VARIABLES AND TYPES CITS1001

VARIABLES AND TYPES CITS1001 VARIABLES AND TYPES CITS1001 Scope of this lecture Types in Java the eight primitive types the unlimited number of object types Values and References The Golden Rule Primitive types Every piece of data

More information

CS 11 java track: lecture 1

CS 11 java track: lecture 1 CS 11 java track: lecture 1 Administrivia need a CS cluster account http://www.cs.caltech.edu/ cgi-bin/sysadmin/account_request.cgi need to know UNIX www.its.caltech.edu/its/facilities/labsclusters/ unix/unixtutorial.shtml

More information

Final CSE 131B Spring 2005

Final CSE 131B Spring 2005 Login name Signature Name Student ID Final CSE 131B Spring 2005 Page 1 Page 2 Page 3 Page 4 Page 5 Page 6 Page 7 Page 8 (27 points) (24 points) (32 points) (24 points) (32 points) (26 points) (31 points)

More information

VisiBroker Release Notes

VisiBroker Release Notes VisiBroker 8.5.2 Release Notes Micro Focus The Lawn 22-30 Old Bath Road Newbury, Berkshire RG14 1QN UK http://www.microfocus.com Copyright Micro Focus 2015. All rights reserved. VisiBroker contains derivative

More information

Page 1. Agenda. Programming Languages. C Compilation Process

Page 1. Agenda. Programming Languages. C Compilation Process EE 472 Embedded Systems Dr. Shwetak Patel Assistant Professor Computer Science & Engineering Electrical Engineering Agenda Announcements C programming intro + pointers Shwetak N. Patel - EE 472 2 Programming

More information

Java On Steroids: Sun s High-Performance Java Implementation. History

Java On Steroids: Sun s High-Performance Java Implementation. History Java On Steroids: Sun s High-Performance Java Implementation Urs Hölzle Lars Bak Steffen Grarup Robert Griesemer Srdjan Mitrovic Sun Microsystems History First Java implementations: interpreters compact

More information

Application Compatibility Guide

Application Compatibility Guide Application Compatibility Guide Micro Focus The Lawn 22-30 Old Bath Road Newbury, Berkshire RG14 1QN UK http://www.microfocus.com Copyright Micro Focus 2018. All rights reserved. MICRO FOCUS, the Micro

More information

CSE 307: Principles of Programming Languages

CSE 307: Principles of Programming Languages CSE 307: Principles of Programming Languages Variables and Constants R. Sekar 1 / 22 Topics 2 / 22 Variables and Constants Variables are stored in memory, whereas constants need not be. Value of variables

More information

BEA JRockit. Introduction to BEA JRockit SDK

BEA JRockit. Introduction to BEA JRockit SDK BEA JRockit Introduction to BEA JRockit SDK Version 1.4.2 December 2004 Copyright Copyright 2004 BEA Systems, Inc. All Rights Reserved. Restricted Rights Legend This software and documentation is subject

More information

Tivoli SecureWay Policy Director Authorization ADK. Developer Reference. Version 3.8

Tivoli SecureWay Policy Director Authorization ADK. Developer Reference. Version 3.8 Tivoli SecureWay Policy Director Authorization ADK Developer Reference Version 3.8 Tivoli SecureWay Policy Director Authorization ADK Developer Reference Version 3.8 Tivoli SecureWay Policy Director Authorization

More information

1. What is Jav a? simple

1. What is Jav a? simple 1. What is Jav a? Thanks to Java is a new programming language developed at Sun under the direction of James Gosling. As far as possible it is based on concepts from C, Objective C and C++. Java is interpreted

More information

Essential characteristics of Java

Essential characteristics of Java TALLINN UNIVERSITY OF TECHNOLOGY Department of computer engineering Chair of Digital Systems Design Oleg Dmitrijev 121998 IASM Essential characteristics of Java Analysis of Programming Languages (IAG0450)

More information