Quote from: waterwingz on 08 / April / 2013, 23:43:04Something tells me Lua is not going to end up in SDM any time soon.It will NEVER be supported by SDM, why should it ?We are just taking photos, not testing elegant programming techniques for the benefit of developers.If a user really needs Lua (which is difficult to believe) just use CHDK.In fact, I have suggested to someone that the new SDM installer should download SDM and CHDK, the CHDK DISKBOOT file having its extension temporarily changed.
Something tells me Lua is not going to end up in SDM any time soon.
I tried removing 'Lt' and just using 'L' and it all still seems to work - I'm sure there is a reason for it, just curious as to what it is.
It seems like it would add a lot of unnecessary complexity to have 2 lua threads running in one task.
Question - why does 'lua_script_start' create a new Lua thread/state (Lt), and run the script on that thread instead of just using the main thread/state created by lua_open (L)?
Quote from: philmoz on 09 / April / 2013, 19:11:44Question - why does 'lua_script_start' create a new Lua thread/state (Lt), and run the script on that thread instead of just using the main thread/state created by lua_open (L)?I don't know for sure, but I would guess it's because the lua_resume documentation suggests that you need to create a thread first: http://www.lua.org/manual/5.1/manual.html#lua_newthreadTo expand on my previous reply, everything happens in Lt, so the "other thread" really isn't doing anything, or adding significant complexity or resource usage.These posts http://lua-users.org/lists/lua-l/2012-02/msg00078.htmlhttp://lua-users.org/lists/lua-l/2004-03/msg00007.html (note this is quite old!)suggests that it would be OK to just use the main thread. I didn't find any detailed discussion with a quick search.Also be careful with your "L". The global L refers to the original global lua state, but the L parameter in the functions must generally refer to Lt.
All of which led me to wonder why we need Lt in the first place - seems like it may not be needed.
Quote from: philmoz on 09 / April / 2013, 22:26:48All of which led me to wonder why we need Lt in the first place - seems like it may not be needed.It would have to be very broken indeed to collect an active (running / suspended) thread.
Is it possible the lua_script_start code is not properly saving a reference to Lt?
Started by flarn2006 Feature Requests
Started by waterwingz General Discussion and Assistance
Started by philmoz « 1 2 3 4 » General Discussion and Assistance
Started by waffenschmidt Hotwire! Hardware Mods, Accessories and Insights
Started by reyalp General Discussion and Assistance