tutorial 1. q1: compare and contrast between multiprocessors and multicore multicore – dual-core...

5
Tutorial 1

Upload: violet-blake

Post on 30-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Tutorial 1. Q1: Compare and contrast between multiprocessors and multicore Multicore – Dual-core processor has two cores (e.g. AMD Phenom II X2, Intel

Tutorial 1

Page 2: Tutorial 1. Q1: Compare and contrast between multiprocessors and multicore Multicore – Dual-core processor has two cores (e.g. AMD Phenom II X2, Intel

Q1: Compare and contrast between multiprocessors and multicore

• Multicore – Dual-core processor has two cores (e.g. AMD Phenom II X2, Intel Core Duo),– Quad-core processor contains four cores (e.g. AMD Phenom II X4, intel's quad-core processors,

see i3, i5, and i7 at Intel Core), – Hexa-core processor contains six cores (e.g. AMD Phenom II X6, Intel Core i7 Extreme Edition

980X), – Octa-core processor contains eight cores (e.g. Intel Xeon E7-2820).

wikipedia

Page 3: Tutorial 1. Q1: Compare and contrast between multiprocessors and multicore Multicore – Dual-core processor has two cores (e.g. AMD Phenom II X2, Intel

Q2 : List and discuss different compilers for Java programming language.

• A Java compiler is a compiler for the Java programming language. The most common form of output from a Java compiler is Java class files containing platform-neutral Java bytecode. There exist also compilers emitting optimized native machine code for a particular hardware/operating system combination.

• As of 2010, the following are major Java compilers:– Javac "java-see", included in JDK from Sun Microsystems, open-sourced

since 13 November 2006.– GNU Compiler for Java, a part of the GNU Compiler Collection, which

compiles C, Fortran, Pascal and other programming languages besides Java. It can also generate native codeusing the back-end of GCC.

– ECJ, the Eclipse Compiler for Java, is an open source incremental compiler used by the Eclipse project.

http://en.wikipedia.org/wiki/Java_compiler

Page 4: Tutorial 1. Q1: Compare and contrast between multiprocessors and multicore Multicore – Dual-core processor has two cores (e.g. AMD Phenom II X2, Intel

Exercise• Go to command prompt:– Open a notepad and write the following code. Save it as

HelloWorld.java

class HelloWorld { public static void main(String args[])

{ System.out.println("Hello World!"); }

}

Page 5: Tutorial 1. Q1: Compare and contrast between multiprocessors and multicore Multicore – Dual-core processor has two cores (e.g. AMD Phenom II X2, Intel

Exercise• Run Command Prompt (found under All Programs/Accessories in the Start menu). • Type

– C:\> cd \mywork • This makes C:\mywork the current directory.

– C:\mywork> dir • This displays the directory contents.

– You should see HelloWorld.java among the files.– C:\mywork> set path=%path%;C:\Program Files\Java\jdk1.5.0_09\bin

• This tells the system where to find JDK programs.

– C:\mywork> javac HelloWorld.javaThis runs javac.exe, the compiler. – You should see nothing but the next system prompt...– C:\mywork> dir

• javac has created the HelloWorld.class file.

– You should see HelloWorld.java andHelloWorld.class among the files– .C:\mywork> java HelloWorld

• This runs the Java interpreter.

– You should see the program output:Hello, World!– If the system cannot find javac, check the set path command. – If javac runs but you get errors, check your Java text. – If the program compiles but you get an exception, check the spelling and capitalization in the file name

and the class name and the java HelloWorld command. Java is case-sensitive!

http://www.skylit.com/javamethods/faqs/javaindos.html