อยากทราบว่า ตัว Virtual Machine คืออะไรและทำงานอย่างไร ในแต่ละ edition ของ java ตัว VM จะทำงานเหมือนกันมั้ย เช่น Hotsport VM ของ J2EE และ JVM ของ J2SE
แล้ว CVM และ KVM ของ J2ME ต่างกันอย่างไร
วอนผู้รู้ช่วยตอบที
อยากทราบว่า ตัว Virtual Machine คืออะไรและทำงานอย่างไร ในแต่ละ edition ของ java ตัว VM จะทำงานเหมือนกันมั้ย เช่น Hotsport VM ของ J2EE และ JVM ของ J2SE
แล้ว CVM และ KVM ของ J2ME ต่างกันอย่างไร
วอนผู้รู้ช่วยตอบที
virtual machine
1) Virtual machine is a term used by Sun Microsystems, developers of the Java programming language and runtime environment, to describe software that acts as an interface between compiler Java binary code and the microprocessor (or "hardware platform") that actually performs the program's instructions. Once a Java virtual machine has been provided for a platform, any Java program (which, after compilation, is called bytecode) can run on that platform. Java was designed to allow application programs to be built that could be run on any platform without having to be rewritten or recompiled by the programmer for each separate platform. Java's virtual machine makes this possible.
The Java virtual machine specification defines an abstract rather than a real "machine" (or processor) and specifies an instruction set, a set of registers, a stack, a "garbage heap," and a method area. The real implementation of this abstract or logically defined processor can be in other code that is recognized by the real processor or be built into the microchip processor itself.
The output of "compiling" a Java source program (a set of Java language statements) is called bytecode. A Java virtual machine can either interpret the bytecode one instruction at a time (mapping it to a real microprocessor instruction) or the bytecode can be compiled further for the real microprocessor using what is called a just-in-time compiler.
2) At IBM, a virtual machine is any multi-user shared-resource operating system that gives each user the appearance of having sole control of all the resources of the system.
3) At IBM, a virtual machine is also used to mean an operating system that is in turn managed by an underlying control progam. Thus, IBM's VM/ESA can control multiple virtual machines on an IBM S/390 system.
4) Elsewhere, virtual machine has been used to mean either an operating system or any program that runs a computer. We quote:
"A running program is often referred to as a virtual machine - a machine that doesn't exist as a matter of actual physical reality. The virtual machine idea is itself one of the most elegant in the history of technology and is a crucial step in the evolution of ideas about software. To come up with it, scientists and technologists had to recognize that a computer running a program isn't merely a washer doing laundry. A washer is a washer whatever clothes you put inside, but when you put a new program in a computer, it becomes a new machine.... The virtual machine: A way of understanding software that frees us to think of :-)sign as machine design."
From David Gelernter's "Truth, Beauty, and the Virtual Machine," Discover Magazine, September 1997, p. 72.
สรุปก็คือว่าตัว Versual Machine เป็นตัวกลางระหว่าง ตัว Compiler and hardwere ที่จะช่วยให้ java สามารถ write one run anywhere ได้ใช่หรือเปล่า และพื้นฐานการทำงานของทุก edition ของ java ก็ทำเหมือนกันเพียงแต่มีชื่อเรียกที่ต่างกัน
CVM ไว้ใช้กับพวก CDC ครับได้แก่พวก device ที่มีหน่วยความจำตั้งแต่ 1 MB ขึ้นไปจนถึงประมาณ 10 MB เช่น โทรศัพท์โนเกียรุ่นซีรี่ 9 (communicator) หรือ พวกอุปกรณ์รับสัญญานโทรทัศน์
KVM ไว้ใช้กับพวก CLDC เป็น device ที่มีหน่วยความจำตั้งแต่ 160 - 512 kb ยกตัวอย่างเช่นมือถือต่างๆ, PDA เป็นต้น
ที่ต้องมี VM หลายแบบเพื่อให้เหมาะกับขนาดและหน่วยความจำของ device แต่ละประเภทครับ
Actions : (View-Readers)
There are no names to display.