ExecutionEngine and multithreading

Hi,

I have a question regarding
ExecutionEngine on multicore machines.

Say I have n different Function objects
that I want to execute simultaneously on a multicore
machine. So, one would want to create n different
instances of ExecutionEngine and run each function.
But, if I understand correctly, there can only be one
instance of ExecutionEngine, so there would have to be
a locking mechanism or execute everything
sequentially.

I have the following questions:
1. What's the best way to run many different functions
in multiple threads using a single ExecutionEngine?
2. What's the reason for having only a single engine?
3. Are there any plans for the future that might
allow multiple instances of ExecutionEngine?

Marko

Say I have n different Function objects
that I want to execute simultaneously on a multicore
machine. So, one would want to create n different
instances of ExecutionEngine and run each function.
But, if I understand correctly, there can only be one
instance of ExecutionEngine, so there would have to be
a locking mechanism or execute everything
sequentially.

Right.

I have the following questions:
1. What's the best way to run many different functions
in multiple threads using a single ExecutionEngine?

You shouldn't have to do anything special. It only holds the lock when jiting, not when executing the code.

2. What's the reason for having only a single engine?

It makes the internal implementation more efficient.

3. Are there any plans for the future that might
allow multiple instances of ExecutionEngine?

no

-Chris