lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I think Lanes and other solutions use the operating system resources to do multithreading, making it possible to utilize multicore CPUs. So they have OS dependencies. Maybe I am wrong in the above assumption, in which case I would really like to know.
         With the method I am using it has no OS dependency at all and will run in all systems ANSI C works i.e. basically wherever Lua works. Drawbacks are that it does not utilize multicore CPUs since everything runs on one process by time slicing the scripts and second is that blocking functions in the script will block the whole time slicing intention so the scripts being multi threaded should be provided blocking functions in the environment which take care of releasing control back to the time slicer program. That would be acceptable in many cases and I think would fit nicely for my requirement considering the benefit that I have no OS dependency at all which is my prime objective.
         I would be interested in listening to other pros and cons that might come to mind.

Thanks,
Milind



On Wed, Feb 19, 2014 at 7:14 AM, Benoit Germain <bnt.germain@gmail.com> wrote:
2014-02-19 15:35 GMT+01:00 Milind Gupta <milind.gupta@gmail.com>:

Hi,
        Thanks for your reply. My intention is to create 2 totally independent lua scripts running in parallel. So I run them in completely separate Lua States since I don't want their global space to overlap.
        I figured out that I was never yielding from the coroutine so I fixed my code like this which is working good. So now I want to write a module in C which when called from Lua would allow the lua program to run multiple lua scripts simultaneously without needing any support from the OS.


There are several existing solutions for this. Have a look at Lanes for example.


--
Benoit.