The compiled machine code may may not directly executable physical processor
A compiler is a program that translates a source program/code written in some high-level programming language (such as Java) into machine code for some computer architecture Byte code (in case of java). Java byte code is similar to machine language which can be translated by various platforms into their native assembly instructions that runs on that platform. The JVM uses byte code and interprets it as native machine code until the JVM decides to compile it. First java source code is complied with JAVAC tool into Byte code then Byte code is further compiled in native code using java just in time (JIT) compiler. The compiled machine code may or may not be directly executable on a physical processor. If no corresponding processor exists, For example to execute byte code, we use a virtual machine to simulate the imaginary processor (JVM).
Where as an interpreter is a program which interpreter the program written in scrip and that can be executed by CPU and it interpreter the program line by line. Interpreter executes the program line by line that means it first go to first line of the executable codes in the program and then next line and this steps are followed till the end of the file. This means that statements from the source program are fetched and executed one by one line, One more important thing is, interpreter program needs to be loaded into memory alongside the source program and it will re-interpret the program each time we wanted to run it. Since compiler like Java and most of the interpreter are written in the language itself, they are easier to port to different O.S and different architectures. An interpreter's only weakness is lackluster performance compared to natively compiled machine code.
Conclusion and Comments
It is better to use Compiler program.
Cigarette can be only made if all the three ingredient(tobacco, paper, and matches) resources are free to use
One processes has paper,
Objective: To synchronies the three process and make it deadlock free if possible
.
I 0 to 2.
process_wait(agent);
process_signal(a[i]);
until false;
All the process (smokers ) waits for the signal to continue the process


