So I explain more my project.
I do intensive calculation.
Code is write in Basic, originally .NET then translate to B4A.
In .NET I use Parallel.For to distribute calculation in multiple thread and better use multi-core processor.
In B4A I make a class for ParallelFor in Basic using Agraham Threading library.
Each class of my math library (vector, matrix, etc...) have property to associate, or not, instance of ParalleleFor class then this is propagate to results.
But this implementation in Basic it's not really efficient, so I try to use java.util.concurrent.
For now I test it with raiseEvent, and it's already better, but to correctly distribute call, I need to have Basic + Java library with this step :
- Receive call to Basic ParallelFor class with function name, container and list of item to loop.
- Call Java ParallelFor class for launching concurrent thread that raiseEvent and wait termination.
- Receive events in Basic ParallelFor class to callback correct calculation function.
If I can directly call basic function from Java code, I can completely remove Basic part and I expect better result.
I expect it's more clear now.