[Mono-dev] Long execution time on first execution (in AOT case)
Martin Däumler
mdae at cs.tu-chemnitz.de
Fri Aug 20 04:20:14 EDT 2010
Miguel de Icaza wrote:
> Hello,
>
> I want to know how to make the execution of a code snippet/method
> deterministic, i.e., like C code can be deterministic, not necessarily
> "fast". That is, I tolerate a kind of "initialization" at startup time
> of Mono, but the first execution must not take (much) more time than
> following executions of the code snippet.
>
>
> A low-tech solution is to make sure you execute all the code paths that
> you will need before entering your deterministic phase.
Hello,
I implemented pre-(JIT)-compilation of (nearly) all possibly called
methods (including mscorlib) by using the original Mono JIT compiler,
that is by calling "mono_compile_method()" for each method. Secondly, I
want to execute all emitted trampolines in advance. So far, the code
works. However, I guess having a race condition. The pre-compilation of
the assemblies and the pre-execution of the trampolines takes place in
method "main_thread_handler()", driver.c, right before calling
"mono_jit_exec()".
How can I protect the compiled code? Using the Loader Lock and the
Domain Lock do not work. Would the JIT Lock work and how can I make
it available in "main_thread_handler()"?
With kind regards,
Martin Däumler
More information about the Mono-devel-list
mailing list