On Sun, 2009-09-06 at 11:06 +0100, Warren Vick wrote:
> Hi Jon,
> 
> Thanks for the reply. From what I read about the GIL, I thought it was 
> something inherent in Python and not controllable. Are you sure that 
> releasing the GIL during the Mapnik render is not just declaring to the 
> Python runtime that a switch of thread execution can take place here? i.e. a 
> thread safe area.
> 
> Here's a Wiki entry on GIL:
> http://en.wikipedia.org/wiki/Global_Interpreter_Lock
> 
> The bit I noted was " Applications written in languages with a GIL have to 
> use separate processes (i.e. interpreters) to achieve full concurrency, as 
> each interpreter has its own GIL.". Doesn't this suggest that to use multiple 
> cores/processors for tiling, separate processes are the way to go rather than 
> multiple threads? Threading looks pretty simple in Python so I'll look at 
> doing some performance tests myself.

It is true that just releasing the GIL is insufficient, you also need to
write the program to use multiple threads to allow something else to
occur when the GIL has been released. This is why the current
generate_tiles.py code fails to take advantage of the mapnik threading.

It is also true that to achieve full concurrency it is easiest to use
multiple processes since this avoid any problems with the GIL. This is
what we have suggested people should do in the past -- just launch
multiple copies of generate_tiles with a different bbox or zoom range in
each instance.

        Jon



_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to