[Tilesathome] Patch for Tiles at home running with two processes

Jocelyn Jaubert jocelyn.jaubert at gmail.com
Mon Nov 19 19:24:36 GMT 2007


Hi,

I have just made a patch so that tilesGen.pl forks in RenderTile
function (which generates png from svg). It is quite simple, as it
calls fork() at the first run of RenderTile. Parent and child then just
draw a different part of the tile.

I originally wanted to make it multi-thread, but it segfaulted in the
for loop line 1237, but I didn't investigate any more. (it could be a
problem in how GD library is used).

Patch contains the following modifications:

 * make temporary files safer, by using tempfile() to generate unique
file names.
 * addition of $parent_pid so that the child can get the name of the
output-* files used by xml2svg(). This could be replaced by using
coordinates of the tile in file name.
 * a new configuration in tilesAtHome.conf to enable or deactivate
fork().

I measured time on a very simple tile (2129,1489) which contains only a
road. Total time went from 2:30 to 1:30 on my dual core.


The patch can be easily be modified to use 3 children instead of only 1,
and I think that xml2svg could use some fork() too.


Jocelyn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-fork.diff
Type: text/x-patch
Size: 5502 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/tilesathome/attachments/20071119/0fab4091/attachment.bin>


More information about the Tilesathome mailing list