On 5/13/06, Steve Kieu <[EMAIL PROTECTED]> wrote:
> thinking about using luasocket (kepler project) as well but their uses of
> coroutine (copas) make me a bit uncomfortable :-). And me think wxLua

Sorry never tried this either.
couroutine in lua IMHO is not really a replacement for thread. But I think
using it in wxLua is convinient enough to overcome the limitation; as if I
have a
lua_interp = new wxLuaState(NULL, wxID_ANY);
and whenever I do  a

int retval=lua_interp->RunFile(lua_file);

wxApp will spawn a new thread (?)  to run the lua file and control return
immediately. If this is correct then I can spawn several lua_file in
OnInit() without blocking the GUI; and the lua_file might be for the server
process, the GUI.

Correct me if I am wrong please.

The wxApp will not spawn a new thread. wxLua runs the lua code in the
main thread since it may create GUI elements and therefore *has* to be
in the main thread. However the wxWidgets sockets use events so that
you can make them non blocking. In this way you can create as many
wxLuaStates creating as many wxSockets as you like with each
wxLuaState's lua program handling the wxSocketEvents appropriately.

> already provide wxLuaSocket why not using it (even it is not easy to not
> link with it anyway)

I don't know know what you mean by this?
:-).  If you enable wxLuaDebug then you need to enable wxLuaSocket and have
to link your application with it even not using it, that is what I mean. But
I can build the library only without debug and socket and wxlua, which is
fine, just save about 400Kb of size though.

Ok, yes this is probably not clear, I will try to write a little about
it in the docs. But to be sure, wxLuaDebug is just some simple
debugging code for wxLua and wxLuaSocket is socket code for wxLua to
communicate with another wxLua program for debugging.

To turn them off set in modules/wxbind/setup/wxluasetup.h
#define wxLUA_USE_wxLuaDebugServer              0
otherwise the bindings will have the wxLuaDebugServer which the wxlua
app uses to debug programs and therefore you have to link to the
wxLuaSocket module.


Regards,
   John Labenski


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Wxlua-users mailing list
Wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to