-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mathias Fröhlich wrote:
> Hi,
> 
> On Thursday 24 May 2007, Tim Moore wrote:
>> OSG reference counting doesn't need to be thread safe, even in the
>> multi-threaded OSG modes, unless you're doing something very tricky. In
>> any event, it shouldn't be turned on in the model reader initialization.
> 
> Please don't!
> It is there by intention.
OK, but maybe this call shouldn't be buried in the initialization of the
 model loader. osgViewer::Viewer changes this mode for threading models
that need it, and maybe your new viewer should do the same.

> I have a multithreaded viewer in the works and for that it is still useful to 
> have thread safe reference counting in place.
> Also Having the database pager set up once we have the osgviewer code settled 
> we will do model loading in a thread that runs in parallel to the rest of the 
> application. And remember that we share some data across models. That model 
> cloning will need thread safe reference counting.
> It does not cost much OTOH.

Here's a somewhat unscientific test :
 src/Main/fgfs --fg-root=/home/moore/graphics/FlightGear/data/
- --aircraft=bo105 --disable-ai-models --geometry=1024x768

time of day: noon.

Without thread safe reference counting (time in milliseconds):
event 5.75
update 3.3
cull 1.75
draw 3.6
Total: 14.4

event 5.75
update 3.83
cull 1.83
draw 3.75
Total: 15.16

So, .76ms, or a 5% difference... I think this is fairly significant.

The real cost will come when we start doing database paging: that's when
a lot of Referenced objects will have their reference counts changed. In
normal operation database paging doesn't need threadsafe reference counting.

You have a good point about copying models. The thread safe mode can be
set per Referenced object, which may be a better way of dealing with
shared objects.

Tim

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFGV/TDeDhWHdXrDRURAprLAJsHVi/Pb96Bx6vFfLzFNuUIkoiouwCgmqAr
BEDvR4SEE4jEHdoIkZIrW0I=
=0MLv
-----END PGP SIGNATURE-----

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to