<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Linux and Java experts, <br>
    <br>
    My son is about to start a project that aims to research variations
    in small code snippets that are automatically generated by a kind of
    compiler. <br>
    <br>
    Of course he uses fpc to do the "testing system", that also includes
    the "compiler".<br>
    <br>
    Now he needs to start the code snippets.  As the system needs to do
    billions of "starts" of such snippets, which are very small, saving
    them in files as an executable does not seem appropriate. <br>
    <br>
    We discussed the protection features done by the MMU hardware and
    agreed to try two different ways to accomplish the task of running
    the code snippets in a "sandbox". <br>
    <br>
    <br>
    1) The "traditional Linux" way would be to have the main process
    create the code to be started in a RAM area <b>as X86-64 native
      code</b> and then use "fork()" with the appropriate options to
    start it as a newly spawned process. Here the question is how to use
    fork() (from fpc) for exactly this: i.e. the code area needs to be
    "writable data" for the parent process and "protected code" for the
    child. (Linux experts, please...) <br>
    <br>
    2) The "modernistic" way would be to have the main process create
    the code to be started in a RAM area <b>as Java Byte code</b> and
    then call a Java "just-in-time" engine (as a DLL) to execute it.
    Here the question is how an already initialized, extremely
    lightweight Java engine can be called from fpc to execute a Byte
    Code sequence residing in the parent's RAM, in a protected way.
    (Java experts, please...) <br>
    <br>
    Thanks in Advance,<br>
    -Michael<br>
    <br>
  </body>
</html>