libqtlua-list
[Top][All Lists]
Advanced

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

Re: [Libqtlua-list] QtLua newbie.


From: Joonhwan Lee
Subject: Re: [Libqtlua-list] QtLua newbie.
Date: Sat, 2 Feb 2013 02:11:32 +0900

Thanks for your explanation. appreciated. 
Could I get a little bit more Info about why QAtomicInt is not appropriate and How could thread-safety be possible to be achieved  by GNU compiler ? 



2013/2/1 Alexandre Becoulet <address@hidden>
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





--
이준환
www.joonhwan.org

reply via email to

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