Re: [gdal-dev] Multithreading with OGR

2010-06-25 Thread Frank Warmerdam
Martin Dobias wrote: On Fri, Jun 25, 2010 at 5:55 PM, Frank Warmerdam wrote: My intent is to use two OGRLayer instances of the same layer: one instance for handling various stuff in main thread, the other one in worker thread for rendering. Can I expect the GetNextFeature calls to be reentrant,

Re: [gdal-dev] Multithreading with OGR

2010-06-25 Thread Martin Dobias
On Fri, Jun 25, 2010 at 5:55 PM, Frank Warmerdam wrote: >> My intent is to use two OGRLayer instances of the same layer: one >> instance for handling various stuff in main thread, the other one in >> worker thread for rendering. Can I expect the GetNextFeature calls to >> be reentrant, i.e. can th

Re: [gdal-dev] Multithreading with OGR

2010-06-25 Thread Frank Warmerdam
Martin Dobias wrote: Hi Frank On Wed, Jun 23, 2010 at 4:58 PM, Frank Warmerdam wrote: Martin, Generally speaking it is not safe to have multiple threads making calls into a single OGRLayer at the same time. At the very least you will encounter the "messing up" effect on GetNextFeature(), eve

Re: [gdal-dev] Multithreading with OGR

2010-06-24 Thread Martin Dobias
Hi Frank On Wed, Jun 23, 2010 at 4:58 PM, Frank Warmerdam wrote: > Martin, > > Generally speaking it is not safe to have multiple threads making calls > into a single OGRLayer at the same time.  At the very least you will > encounter the "messing up" effect on GetNextFeature(), even if you > seri

Re: [gdal-dev] Multithreading with OGR

2010-06-23 Thread Frank Warmerdam
Martin Dobias wrote: So my only problem is to avoid concurrent reads from both main thread and worker thread. How can be this best accomplished without serializing the access? Your reads are eventually going to be serialized by the disk controller anyway, so what is the problem with serializing

Re: [gdal-dev] Multithreading with OGR

2010-06-23 Thread Martin Dobias
Hi Ed On Wed, Jun 23, 2010 at 3:18 PM, Grissom, Edward (Ed) wrote: > In a previous message, Martin said: > >> So my only problem is to avoid concurrent reads from >> both main thread and worker thread. How can be this >> best accomplished without serializing the access? > > Your reads are eventua

Re: [gdal-dev] Multithreading with OGR

2010-06-23 Thread Martin Dobias
Hi Ari On Wed, Jun 23, 2010 at 7:32 AM, Ari Jolma wrote: > Martin, > > Just a comment. In Geoinformatica, which uses GTK+, I've begun to address > the same kind of problem using the functions provided by GTK+. So far I've > not used this on rendering and I've not thought about all the consequenci

Re: [gdal-dev] Multithreading with OGR

2010-06-22 Thread Ari Jolma
Martin, Just a comment. In Geoinformatica, which uses GTK+, I've begun to address the same kind of problem using the functions provided by GTK+. So far I've not used this on rendering and I've not thought about all the consequencies. In some expectedly lengthly GDAL operations it provides a m

[gdal-dev] Multithreading with OGR

2010-06-22 Thread Martin Dobias
Hi all, in my GSoC project [1] I'm trying to employ multithreading to make rendering in QGIS both faster (on multi-core machines) and more pleasant to use (not blocking GUI thread while rendering). I've been successful with making that work in "ideal" conditions (no concurrent reads/writes) and no