[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Question regarding the XML parser binding in PIL
- From: Florian Weimer <fw@...>
- Date: Fri, 21 Nov 2008 16:31:34 +0100
The PIL XML parser example has this code:
| static int lxp_parse (lua_State *L) {
[...]
| xpu->L = L; /* set Lua state */
The C callbacks use this L as the Lua state for C-to-Lua calls. I can
see that this works if the XML parser object is only accessed through
Lua (before every callback, L is properly initialized). In a similar
case, I would like to avoid this restriction. Is it sufficient to
create a new Lua thread and use its state in the callback? In
general, I would feel more comfortable about such an approach.