Hi,
Many thanks for kind words !
Sadly, the magic happened :). The good news is that it was my fault,
the bad news it that my worst nightmare happened ... :(
After I write my first mail I begin to cherry-pick all my changes from
alpha4 and put them on top of alpha3 branch, then I spot a patch which
caught my attention, and I really hoped it's not the cause of this
problem, but it was ...
Some time ago somebody complained on this mailing list about the fact
that he could not be able to compile necessitas anymore using ndk-r7,
soon I discovered that the atomics functions where not exported
anymore in ndk-r7, then my nightmare began, first I post the problem
on android-ndk mailing list[1], then Google suggest me that I should
switch to gcc's built in atomics which I did[2]. I knew that the gcc
built in atomics are not the fastest in the world, but I never thought
that they are that bad. Android atomics support on necessitas is a
long story, which began more than a year ago, I'll try to make it
shorter for you :)
For the very first android atomics implementation, I used Qt's arm
atomics, but I had to switch to gcc built-in atomics (yes, the second
implementation was based on gcc atomics) because Qt's arm5 atomics
where useless for Android, I'll try to explain why: The problem is
that Qt's arm5 atomics are not SMP safe, so, is probable that your app
will crash on a dual-core device. arm5 is very important because it is
supported by all arm android devices, so it must be SMP safe. I
address this problem last year at QCS[3], and somebody offer to help,
but sadly nothing happened. So, I had to find a solution myself, GCC's
implementation is using a sort of memory barrier (a mutext or
something) to make it SMP safe, that why is so slow, then I discover
that google is providing atomics in libc, which they should be SMP
safe, so I switched to android atomics, then google change their mind
and now they are dropping the support, so I had to switch back to gcc.
To "fix" this problem I see the following "solutions":
1. Ignore Google warning and keep using android atomics.
2. Stay with gcc atomics, but is too slow.
3. Build Qt libs with fast atomics, but find a way to have safe
atomics for arm5.
4. Build Qt libs with fast atomics, but use GCC atomics for apps.
5. Build Qt libs with fast atomics, but don't make qt atomics inline
anymore, this way your apps will use what qt provides for that
platform. They will be a little by slower but they should be safe.
This is my favorite solution, but I afraid that it will break the ABI
...
It is safe to build Qt libs with fast atomics for arm5 because arm5
libs will be downloaded Ministro *only* on arm5 devices and AFAIK
there is no SMP arm5 device. The problem is that your apps are not
downloaded by Ministro :) and if they are built only using armv5 they
will be loaded by a SMP device and they will have problems, so arm5
atomics must be SMP safe.
Anyway we have to address the problem once and for all !
If any of you has any other Ideas please don't hesitate to share them with us.
Also any comments/feedback will be very appreciated.
Cheers,
BogDan.
[1]
https://groups.google.com/group/android-ndk/browse_thread/thread/a792d8392b01f389/ecbad8bb4981ed8d
[2]
http://commits.kde.org/android-qt/aa14a65fd29f20adb7aa22b354c975d76266bed1
[3]
http://community.kde.org/Necessitas/Meetings/QtCS2011
2012/6/10 Bruno Zerbo <
bruno...@gmail.com>: