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"><<a href="mailto:ben@ekran.org">ben@ekran.org</a>></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'm using pix_share.<br>
<br>
I'm not using it to transport video but a data-base of random access<br>
frames.<br>
<br>
Ideally I'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>
> pix_share does do exactly what you ask. The same buffer is used for<br>
> both read and write and I moved 1920x1080@30fps between processes with<br>
> no problem.<br>
><br>
> On Fri, Mar 6, 2009 at 12:59 PM, B. Bogart <<a href="mailto:ben@ekran.org">ben@ekran.org</a><br>
</div><div class="im">> <mailto:<a href="mailto:ben@ekran.org">ben@ekran.org</a>>> wrote:<br>
><br>
> Hey all,<br>
><br>
> Is there a way to share a whole pix_buffer between PD processes?<br>
><br>
> I'm running my SOM stuff in a second PD instance (to make use of the<br>
> second core in my installation machine). But as I'm developing both PD<br>
> instances are getting more coupled and I'd like to share a whole<br>
> pix_buffer.<br>
><br>
> The alternative is using two [pix_share]s, one for input the other for<br>
> output, controlled by netsend. The problem with this is that I need to<br>
> send a lot of data quickly, 10ms between new images, and I think that<br>
> could cause lots of problems.<br>
><br>
> I don't think I'll be able to get the CPU usage of the second patch down<br>
> low enough to not interfere with rendering in the main PD patch.<br>
><br>
> Thanks,<br>
> B.<br>
><br>
> _______________________________________________<br>
> GEM-dev mailing list<br>
</div>> <a href="mailto:GEM-dev@iem.at">GEM-dev@iem.at</a> <mailto:<a href="mailto:GEM-dev@iem.at">GEM-dev@iem.at</a>><br>
<div><div></div><div class="h5">> <a href="http://lists.puredata.info/listinfo/gem-dev" target="_blank">http://lists.puredata.info/listinfo/gem-dev</a><br>
><br>
><br>
</div></div></blockquote></div><br>