[Mono-list] Embedding issues ..
Sun, 9 Feb 2003 16:29:28 +0100
I'm looking for a VM suitable for embedding into a multithreaded
OO database server.
There are a number of crucial aspects that raise questions, which
can only be answered with a deep understanding of the internals of
a particular VM. I do not have that for Mono, so please share your
know-how with me.
Any hints welcome! Greets,
1. The relation between
- database sessions
- OS threads
- VM instances
In a perfect world, I'd like to have a completely isolated VM
instance associated with each database session. The association
would be setup when the database client connects and the VM would
be shut down when the connections ends or timeouts.
Its OK when a VM instance can only be entered by one OS thread
at each time (enforced e.g. by a per VM-lock). However, it should
be allowed to enter the VM instance by different OS threads at different
times. The VM instance to be worked on must be provided by the entering
OS thread of course (some ptr to some VM instance structure e.g.). This
implies e.g., that no thread-local storage is used by the run-time.
In general, the number of working threads within the database kernel
is controlled by the database. It is not necessarily related to the number
of database sessions. I only assume a 1:1 relation between database
sessions and active VM instances.
2. Custom class loader
In a perfect world it should be not that hard to hack the run-time
such that classes/bytecode is not loaded from files in the filesystem
(that is not accessible from the database .. at least it should not),
but classes/bytecode are loaded from the database itself. Classes/bytecode
would be uploaded (under compete transaction control) into the database
via a special interface.
3. Transparent object persistence
Most important, is it possible to hack the run-time (the CTS?) such that
a user can declare new types to be persistable, e.g in C# like so:
public class MyClass
public class MyKeyedClass
Instances of persistable classes are sharable between all VM instances.
All synchronisation is done under the hood by the OO database.