Frank,<br>            thank you for your suggestion.<br>I added a GDALProgressFunc as you suggested.<br>In order to prevent blocking  in the rasterio now I check a state variable indicating when I have to stop the reading.<br>
Since I call rasterio foreach line of the destination bitmap I have added a simple check of the state variable (eg.: if (terminate) then return). Very simple!! I should  have think about it by myself.<br>Now my app can browse without blocking the openstreetmap dataset.<br>
<br>Best regards.<br>Stefano<br><br>- <br>Dr.Eng. Stefano Moratto<br><a href="mailto:stefano.moratto@gmail.com">stefano.moratto@gmail.com</a><br><a href="mailto:stefano.moratto@csiat.it">stefano.moratto@csiat.it</a><br><a href="http://www.csiat.it">http://www.csiat.it</a> - Traffic Optimization Software<br>
<br><br><div class="gmail_quote">On Mon, Jan 31, 2011 at 5:39 PM, Frank Warmerdam <span dir="ltr">&lt;<a href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On 11-01-31 04:26 AM, Stefano Moratto wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br>
           I need to interrupt a RasterIO  and warp calls before they have been<br>
ended.<br>
The call is invoked in a background thread and  It may happen that the user<br>
changes the requested area in the main thread (GUI) (eg. a pan/scroll operation).<br>
</blockquote>
<br></div>
Stefano,<br>
<br>
Algorithms which take a GDALProgressFunc are likely to be interruptable.<br>
Each time the progress function is invoked it has the opportunity to<br>
return an indicate that the operation has been cancelled by the user.<br>
<br>
So the warper can be canceled if you provide a customized progress<br>
function.  But RasterIO cannot since it has no progress function.<br>
<br>
If you want IO to be interruptible you would normally do it in modest<br>
sized chunks, though this can interfere with optimization of the IO in<br>
some cases.<br>
<br>
Best regards,<br>
-- <br>
---------------------------------------+--------------------------------------<br>
I set the clouds in motion - turn up   | Frank Warmerdam, <a href="mailto:warmerdam@pobox.com" target="_blank">warmerdam@pobox.com</a><br>
light and sound - activate the windows | <a href="http://pobox.com/%7Ewarmerdam" target="_blank">http://pobox.com/~warmerdam</a><br>
and watch the world go round - Rush    | Geospatial Programmer for Rent<br>
<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div><br><br clear="all"><br>-<br>