Hi Adrian,

A ReadFileCallback is a reasonable way to enforce serialization
without modifying the core OSG so as a workaround its a pretty elegant
one.

I would actually like to have osgDB working multi-threaded though, not
all plugins are up to it, but the ones like .ive should be, as should
be the other parts of the osgDB library itself.  A year or so I did
work on osgDB that was entirely motivated by making it possible to do
multi-threaded reads, so its disappointing to see it not working in
your case.  There aren't any fundamental reasons why it shouldn't run
multi-threaded so guess that there is bug somewhere along the line
that your usage model is revealing.  Unfortunately I don't have divine
insight or wisdom so can't pin point what this might be... only first
hand testing will suffice, alas I have no time available to do this
right now.

Robert.

On 8/23/07, Adrian Egli <[EMAIL PROTECTED]> wrote:
> Hi robert, thank you for the hint.
>
>  i overwriten the osgDB::Registry::ReadFileCallback
> following the example openflt plugin in my application
>
> if we will add this directly in openscenegraph we no longer have to care
> about the different SERIALIZE() in the other plugins, we will be thread safe
> for all multi pager based applications. w.r.t. the performance we won't lost
> a much fps. Especially if we assume that we only read (A) in one thread
> and (B) not so often as we render things. my it's an option to introduce it
> into OSG.
>
> /regards adegli
>
> ...
>
> virtual osgDB::ReaderWriter::ReadResult openArchive(const std::string&
> filename,ReaderWriter::ArchiveStatus status, unsigned int
> indexBlockSizeHint, const ReaderWriter::Options* useObjectCache) {
>     FILE_RESOURCE_SERIALIZER();
>     osgDB::ReaderWriter::ReadResult ret;
>     ret =
> osgDB::Registry::instance()->openArchiveImplementation(filename,
> status, indexBlockSizeHint, useObjectCache);
>     return ret;
> }
>
> ...
> 2007/8/22, Robert Osfield <[EMAIL PROTECTED]>:
> >
> > Hi Adrian,
> >
> > On 8/22/07, Adrian Egli <[EMAIL PROTECTED]> wrote:
> > > i did some further tests and the problem is in reading two IVE files in
> two
> > > different threads. Then suddenly the system gets block, i don't know
> what
> > > can cause to probleme, i will look depther into the plugin code
> >
> > Try putting a serialize into the readNodeFile in the IVE plugin.
> > There is one in the OpenFlight plugins ReaderWriterFLT.cpp that you
> > could copy.
> >
> > Robert.
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
>
>
>
> --
> ********************************************
> Adrian Egli
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to