interresting idea...<br>the problem with this approach is that parralelizing the rendering is far from being<br>a &quot;free&quot; operation:<br>- memory-wise, you have to allocate n-layers images to render each of them seperately
<br>- computationnaly wise, you have n-layers full image blending operations, which is far <br>from being a light operation.<br><br>I&#39;ve profiled the rendering of a 7 layer map setting each layer to 99% opacity, which currently 
<br>means that the layer is rendered on a temp image and blended onto the map image for each <br>layer ( this roughly simulates the operations that would happen if using your approach, <br>except that we don&#39;t get some of the &quot;free&quot; blended pixels, 
i.e. pixels whose opacity is 100%<br>and therefore are just replaced in the final image instead of composited ). the result is that <br>50% of computing time is spent on the blending operations. <br><br>seeing this, we&#39;d have to make sure that this non negligeable processing supplement is 
<br>compensated by the overhead &#39;won&#39; when doing the i/o for each layer.<br><br>tb<br><br><div><span class="gmail_quote">On 10/12/07, <b class="gmail_sendername">David Fuhry</b> &lt;<a href="mailto:dfuhry@cs.kent.edu">
dfuhry@cs.kent.edu</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Has anyone looked into parallelizing the calls to msDraw[Query]Layer()
<br>in msDrawMap()?<br><br>Although I&#39;m new to the codebase, it seems that near the top of<br>msDrawMap(), we could launch a thread for each (non-WMS/WFS) layer,<br>rendering the layer&#39;s output onto its own imageObj.&nbsp;&nbsp;Then where we now
<br>call msDraw[Query]Layer, wait for thread i to complete, and compose that<br>layer&#39;s imageObj onto the map&#39;s imageObj.<br><br>In msDraw[Query]Layer(), critical sections of the mapObj (adding labels<br>to the label cache, for instance) would need to be protected by a mutex.
<br><br>A threaded approach would let some layers get drawn while others are<br>waiting on I/O or for query results, instead of the current serial<br>approach where each layer is drawn in turn.&nbsp;&nbsp;Multiprocessor machines<br>
could schedule the threads across all of their cores for simultaneous<br>layer rendering.<br><br>It seems this could significantly speed up common-case rendering,<br>especially on big machines, for very little overhead.&nbsp;&nbsp;Has there been
<br>previous work in this area, or are any major drawbacks evident?<br><br>Thanks,<br><br>Dave Fuhry<br></blockquote></div><br>