Page 1 of 1

multithreaded lua api request

Posted: 12 Jun 2010, 16:46
by bishop181
I'd like to request an api for writing multi-threaded lua code (coroutines are not genuinely multi-threaded, ie use multiple processors simultaneously). with a mt version of spring, I think this is a resemble request, and it is easy to add mt api to standard lua (though I appreciate the reasons for not allowing you do do this in spring).

thanks.

Re: multithreaded lua api request

Posted: 12 Jun 2010, 22:45
by aegis
why?

Re: multithreaded lua api request

Posted: 12 Jun 2010, 23:18
by Argh
So that he can write multithreaded Lua applications using the engine?

So that we can make our code multithread aware, and deliberately ask for a processor with less load to handle the code?

I think it'd be grand if we could put a simple request in via Lua where we requested the processor with the least load, instead of the current assumption that we are running all gamecode via processor 1, and all OpenGL via processor 2...

Re: multithreaded lua api request

Posted: 12 Jun 2010, 23:42
by aegis

Re: multithreaded lua api request

Posted: 12 Jun 2010, 23:56
by Argh
So, we basically need that + writing the Lua to be Lanes-aware + a Lua command to Spring that requests the number of processors and their current load.

Re: multithreaded lua api request

Posted: 13 Jun 2010, 00:09
by aegis
no. just lanes. processor load changes so quickly it's better to let the system decide where to run code (with the exception of the smp seesaw method)

and you might only be able to call spring's lua functions from the main lua thread.

Re: multithreaded lua api request

Posted: 13 Jun 2010, 00:17
by Argh
That makes sense.

Re: multithreaded lua api request

Posted: 13 Jun 2010, 01:35
by Master-Athmos
Thanks for the link...