Re:Why VMs are good, mmmmkay
Posted: Sat Apr 02, 2005 11:47 pm
Ah, my bad. I misunderstood your point the first time.AR wrote:I am not an "everything should be open source" fanatic, what I ment is that you could pre-compile for different targets and include multiple binaries for different targets.
That is how it's done, but in addition to that the heap is typically global to the entire process, and it plus the thread stacks are all read/write. Big problems occur when this memory gets stomped on.I may not be aware how libraries function but I was under the impression that they had .text (read-only) and local instance .data/.bss (read-write) and a global data section shared between all instances. If this isn't how it's done then, again that's a flaw in the design.
What you're describing is more like the client/server model in a microkernel rather than shared libraries. The good thing about this model is that it's quite robust... after all, that's why processes have separate address spaces. Unfortunately, performance would suffer way too much if every library had to communicate with the others and with the app via message-passing. The right balance between the two approaches is needed, and the balance shifts depending on the requirements of the application or system as a whole.And what part of the system is going to enforce the use of this mechanism...?
I imagine the Kernel would. You provide a buffer in Kernel space to the library which the library can interact with using a pipe. If that is the only way the library can share data across instances then the programmer is going to have to use it.
I was talking about the way applications are pre-compiled to machine code, distributed as binaries targeted to the specific platform, and run in a manner that gives the language run-time environment very little (or no) supervision over their execution and access to their own memory space.It is impossible for machine code to be obsolete unless you're going to invent a system where the code is interpreted by something that doesn't require hardware.