I would only have the buffer in one process and have the other process(es) request frames to be fed to them.  The shared memory process used by pix_share uses locks so the data can only be read or written by one process at a time, so your massive shared buffer idea is not really any more efficient.  <br>
<br><br>On Fri, Mar 6, 2009 at 5:01 PM, B. Bogart <span dir="ltr">&lt;<a href="mailto:ben@ekran.org">ben@ekran.org</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks Chris + Jack,<br>
<br>
This is already how I&#39;m using pix_share.<br>
<br>
I&#39;m not using it to transport video but a data-base of random access<br>
frames.<br>
<br>
Ideally I&#39;d be able to share the whole pix_buffer, rather than:<br>
<br>
* iterating over each frame a dumping it into a pix_share to be read<br>
into another buffer in the other PD process. (not very memory efficient)<br>
<br>
* Use a separate pix_share for each slot in the pix_buffer. (This is not<br>
very scalable, my patch currently has 2500 slots.)<br>
<br>
I think a [pix_buffer_share] would be a useful object for cases when one<br>
wants to share more than a single frame.<br>
<br>
There I go, dreaming again.<br>
<br>
.b.<br>
<div class="im"><br>
chris clepper wrote:<br>
&gt; pix_share does do exactly what you ask.  The same buffer is used for<br>
&gt; both read and write and I moved 1920x1080@30fps between processes with<br>
&gt; no problem.<br>
&gt;<br>
&gt; On Fri, Mar 6, 2009 at 12:59 PM, B. Bogart &lt;<a href="mailto:ben@ekran.org">ben@ekran.org</a><br>
</div><div class="im">&gt; &lt;mailto:<a href="mailto:ben@ekran.org">ben@ekran.org</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     Hey all,<br>
&gt;<br>
&gt;     Is there a way to share a whole pix_buffer between PD processes?<br>
&gt;<br>
&gt;     I&#39;m running my SOM stuff in a second PD instance (to make use of the<br>
&gt;     second core in my installation machine). But as I&#39;m developing both PD<br>
&gt;     instances are getting more coupled and I&#39;d like to share a whole<br>
&gt;     pix_buffer.<br>
&gt;<br>
&gt;     The alternative is using two [pix_share]s, one for input the other for<br>
&gt;     output, controlled by netsend. The problem with this is that I need to<br>
&gt;     send a lot of data quickly, 10ms between new images, and I think that<br>
&gt;     could cause lots of problems.<br>
&gt;<br>
&gt;     I don&#39;t think I&#39;ll be able to get the CPU usage of the second patch down<br>
&gt;     low enough to not interfere with rendering in the main PD patch.<br>
&gt;<br>
&gt;     Thanks,<br>
&gt;     B.<br>
&gt;<br>
&gt;     _______________________________________________<br>
&gt;     GEM-dev mailing list<br>
</div>&gt;     <a href="mailto:GEM-dev@iem.at">GEM-dev@iem.at</a> &lt;mailto:<a href="mailto:GEM-dev@iem.at">GEM-dev@iem.at</a>&gt;<br>
<div><div></div><div class="h5">&gt;     <a href="http://lists.puredata.info/listinfo/gem-dev" target="_blank">http://lists.puredata.info/listinfo/gem-dev</a><br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br>