Am 08.01.2012 16:11, schrieb Melchior FRANZ:
On Sunday 08 January 2012 05:09:07 Flightgear-commitlogs wrote:
commit 246feef85fedd548f2c198831d7d6e7e3be53e12
Author: ThorstenB
FGNasalModelData isn't thread-safe. [...] It s*cks... ;-)
It predates a separate model loader thread. If something sucks,
it's an imcomplete loader thread implementation (apart from
developers handing out grades without having much clue, that is).
You shortened my commit message. The s*cks was not meant as a grade
for FGNasalModelData or any of its authors. It was a final statement
summarizing a larger issue as a whole. I had spent hours tracing
sporadic memory corruption issues. These really s*ck, since they are not
reliable to reproduce - and once you catch a corruption issue in the
debugger, it's still difficult to find the origin.
Of course, I have very little clue compared to you. You are right, as
ever. However, despite being extremely little minded, I still knew that
FGNasalModelData predates OSG. The part of my commit message, that you
accidentally removed, also states that the issue was only introduced a
short while ago, when the MP aircraft loading was moved to the separate
loader thread. So, yes, things were fine before. And in the 'good old
days' they were anyway.
Melchior, yet again I deeply apologize if that commit has hurt your
sensitive feelings. Sorry, sorry, sorry. It was not meant as a judgement
of any of your involvement in FGNasalModelData, neither of your
outstanding work on FlightGear, from the days when you still supported
the project with useful contributions, instead of only digging through
commit messages to find reasons to spill your poison. The legacy of your
work is perfect and beyond any doubt.
For the rest of the audience - here's the full commit message:
http://www.gitorious.org/fg/flightgear/commit/246feef85fedd548f2c198831d7d6e7e3be53e12
commit 246feef85fedd548f2c198831d7d6e7e3be53e12
Author: ThorstenB
Date: Sun Jan 8 13:28:49 2012 +0100
#553: MP-model-loading related segfault
MP aircraft are loaded by a separate OSG thread (introduced after
FG2.4.0).
The OSG thread also calls the modelLoaded callback. However, we mustn't
allow the OSG thread to call FGNasalModelData::modelLoaded directly:
FGNasalModelData isn't thread-safe. There are obvious issues
(_callCount++;),
tricky issues like calling the Nasal _parser_ or creating hashes and
modifying the global Nasal namespace. It doesn't use locks to protect
against another thread executing a Nasal context or running garbage
collection. It also executes Nasal code itself (the model's load hook),
which we also cannot allow in a separate thread...
This patch returns all Nasal parts of MP-aircraft loading (parsing,
module creation, execution) to the main thread, while keeping the
multi-threaded OSG part (loading of MP-aircraft model files itself).
The same issue exists with scenery models (see other commit).
To summarize with 2 words: It s*cks... ;-)
--
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel