Hi Ryan,

On Mon, Dec 14, 2009 at 10:38 AM, Ryan H. Kawicki
<[email protected]> wrote:
> Observation 1:
> Using the unsafe versions is bad.  Now we know and knowing is half the 
> battler, but should this be take further.  It might be a good idea to tag the 
> unsafe versions as deprecated, this way a compiler warning can be generated.  
> This can be rolled into the 2.10 release of OSG.  I would then say that a 
> version of two later, they can be removed all together.

Within the OSG we should certainly move across to use the ref versions
internally in NodeKits and plugins.

More generally I'm not convinced that we need to deprecate the none
ref versions.  I'd be inclined towards just documenting that
multi-threaded reads should use the Ref versions.

> Observation 2:
> It looks like if you mix cached and uncached operations on different threads, 
> this is the chance that cached objects will be lost by the registry.  I'm not 
> sure how to overcome this issue, and this issue might need a more trained eye 
> and someone with greater knowledge of OSGs internal workings.  I'll leave 
> that up to you and the community to decide this one.

The cache flipping trick used is not good needs to be removed.  I'd be
inclined towards use osgDB::Options to store the cache, and have an in
memory ObjectCache to mirror the current FileCache.  Such an approach
would allow you to override the default ObjectCache to a single read
call, such as ones done from the DatabasePager and avoid the need to
cache flipping completely.

> Observation 3:
> I did try to read osgText::Font objects using a noncached call, but this was 
> a very bad thing to do.  It basically made our entire terrain page in bad 
> texture data.  I'm not sure what the problem was there, but our terrain was 
> paging in with some pink textures.  In any case, I did notice something quite 
> strange or even bad.  When caching of the font objects was off, calling to 
> read the font object internally was caching this data in 
> FreeTypeLibrary::getFont.  The _fontImplementationSet continually was growing 
> and growing.  With caching turned on, the _fontImplementationSet averaged 
> around nine objects, with some of them being the same.  I can only surmise 
> that this was due to the object cache problem I described above and would 
> fall to the same fate as using the noncached version.  In any case, I wanted 
> to point this out, as there might be some optimizations that can be placed 
> here.

Font's really do need to be cached and shared between instanced,
perhaps it even warrant's it's own separate ObjectCache?

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to