Newbe: Threading question

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Newbe: Threading question

Patrick Down
Hi,

I've been looking at Lua for a project that needs a scripting language.
I have to say that I'm really very impressed by what I've seen so far.
Lua is a really easy package to use.

My one question has to do with threading.  I would like to use lua to
customize event handling in my program.  However events can be generated
by multiple threads within the program.  Is Lua thread safe and
reentrant?  If not are there versions that are?

Reply | Threaded
Open this post in threaded view
|

Re: Newbe: Threading question

Luiz Henrique de Figueiredo
>From: Patrick Down <[hidden email]>

>Is Lua thread safe and reentrant?  If not are there versions that are?

The new version is reentrant. It's 4.0 (alpha), available at the ftp sites.
--lhf

Reply | Threaded
Open this post in threaded view
|

test.c

Ashley Fryer-2
Fyi, looks like a documentation error...

In file INSTALL, test.c is listed as one of the required files for luac, but
there is no test.c included with the distribution.

ashley


Reply | Threaded
Open this post in threaded view
|

RE: test.c

Ashley Fryer-2
Here are two more non-existent luac files that are listed in INSTALL:

  opcode.c
  opt.c

> -----Original Message-----
> From: [hidden email] [[hidden email]
> Behalf Of Ashley Fryer
> Sent: Saturday, April 29, 2000 12:24 AM
> To: Multiple recipients of list
> Subject: test.c
> 
> 
> 
> Fyi, looks like a documentation error...
> 
> In file INSTALL, test.c is listed as one of the required files 
> for luac, but
> there is no test.c included with the distribution.
> 
> ashley
> 
> 

Reply | Threaded
Open this post in threaded view
|

Add: lua_dobuffer macro

Ashley Fryer-2
File lua.h is missing the helper macro for single-state lua_dobuffer (am I
the only person using lua_dobuffer? :-).  This is what's required:

#define lua_dobuffer(buff,size,name)
(lua_dobuffer)(lua_state,buff,size,name)

ashley


Reply | Threaded
Open this post in threaded view
|

Doc: explicit lua_open required

Ashley Fryer-2
( I'm upgrading from 3.1 so disregard if this is old news )...

It should be documented that the behavior of the standard library "open"
functions has changed.  In previous versions of Lua, a call to:

    iolib_open();
    strlib_open();
    mathlib_open();

would implicitly call lua_open.  In 4.0 alpha, the functions:

    lua_iolibopen();
    lua_strlibopen();
    lua_mathlibopen();

do not call lua_open.  In fact, these functions assume that lua_open was
already called and attempt to dereference a null lua_state pointer, which
results in a memory exception.  Since this is a case where previously valid
code crashes, it should probably be documented.

Other than the issues noted, the new version is working flawlessly in VC6.
Congratulations on a great job!

ashley


Reply | Threaded
Open this post in threaded view
|

Re: Doc: explicit lua_open required

Roberto Ierusalimschy
> ( I'm upgrading from 3.1 so disregard if this is old news )...
>
>It should be documented that the behavior of the standard library "open"
>functions has changed.  [...]

This is new news... With multi-states, we decided not to implicitly call
lua_open when lua_state is NULL. We will document it properly, and put an
apropriate error message in luaL_openlib.

-- Roberto