<html><head></head><body><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div>Hello,</div><div>I am trying to implement a threaded equivalent of outlet_list(), which recursively copies the content of a list (symbol, argc, argv) into a ringbuffer at one end (worker thread) and retrieves them at the other end (audio thread). I have been looking through the Pd source code in and out but could not find a suitable function, except perhaps for those implemented in the [list] class, but they are not meant to be accessible from outside (static!).</div><div>What is the best way of doing this?</div><div>Thanks</div><div><br></div><div>For reference, here is some code:</div><div>----------------</div><div>a) this is the (working!) ringbuffer implementation I have for outlet_float:</div><div><br></div><div><div>  struct t_outletrb_float_msg {</div><div>      t_outlet* outlet;</div><div>      t_float f;</div><div>  };</div><div><br></div><div>// call this from the audio thread</div><div>  void outletrb_floatprocess(ring_buffer* rb)</div><div>  {</div><div>      while(rb_available_to_read(rb) > sizeof(struct t_outletrb_float_msg))</div><div>      {</div><div>          struct t_outletrb_float_msg msg;</div><div>          rb_read_from_buffer(rb, (char*)&msg, sizeof(msg));</div><div>          t_outlet* x = msg.outlet;</div><div>          t_float f = msg.f;</div><div>          outlet_float(x, f);</div><div>      }</div><div>  }</div><div><br></div><div><span style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 16px;">// call this from the worker thread</span></div><div>void outletrb_float(ring_buffer* rb, t_outlet *x, t_float f)</div><div>  {</div><div>      struct t_outletrb_float_msg msg;</div><div>      msg.outlet = x;</div><div>      msg.f = f;</div><div>      rb_write_to_buffer(rb, 1, (char*)&msg, sizeof(msg));</div><div>  }</div><div><br></div><div>-------------------</div><div>b) and this is the INCOMPLETE ringbuffer implementation of outlet_list:</div><div><br></div><div>  struct t_outletrb_list_msg {</div><div>      t_outlet* outlet;</div><div>      t_symbol* s;</div><div>      int argc;</div><div>      t_atom* argv;</div><div>  }</div><div>// call this from the audio thread</div><div>  void outletrb_listprocess(ring_buffer* rb)</div><div>  {</div><div>///// retrieve the data from rb and use them for outlet_list();</div><div>  }<div><br></div><div>// call this from the worker thread</div><div>  void outletrb_list(ring_buffer* rb, t_outlet *x, t_symbol *s, int argc, t_atom *argv)<br></div><div>  {</div><div>//??????? this is the function I am trying to figure out</div><div>  }<br></div></div><div><br></div><br></div></div></div></body></html>