libqtlua-list
[Top][All Lists]
Advanced

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

Re: [Libqtlua-list] QtLua newbie.


From: Alexandre Becoulet
Subject: Re: [Libqtlua-list] QtLua newbie.
Date: Fri, 01 Feb 2013 14:15:01 +0100
User-agent: KMail/4.9 (Linux/3.5.3-1-ARCH; KDE/4.9.0; x86_64; ; )

On Friday, February 01, 2013 03:21:01 PM Joonhwan Lee wrote:

Hi,

> Question 1 : The #warning message makes me feels that using QtLua in
> multithreaded application is dangerous.
> Is it ?  If not, what things should I take into account for to use it under
> multithreaded environment?

The QtLua smart-pointer class relies on the GNU compiler atomic builtins to 
update its internal reference counter. When this is not available, smart-
pointers are not safe to handle from different threads without explicit 
locking.

Previous versions of QtLua used the portable QAtomicInt class but 
unfortunately it does not provide all the required operations for what is need 
by the last version of QtLua.

If you want to add atomic operation support for your platform, you need to 
patch src/QtLua/qtluaref.hh in a few places.

> Question 2 : I want to use it only for my application access to my own
> QObject. Which example should I learn?

See examples/cpp/qobject and examples/cpp/value. You need to read the doc 
about QObject ownership.

If you use QObject properties with custom types, see examples/cpp/types

examples/cpp/userdata may be of some interest if you want to access non-
QObject c++ classes from lua.

-- 
Alexandre




reply via email to

[Prev in Thread] Current Thread [Next in Thread]