<div dir="ltr">Sorry, one more note:<div style>In libpd, sched_tick is currently calling in the PROCESS macro in the context of the audio callback (in z_libpd.c).</div><div style>The function sched_tick handles all timed objects (such as metro) and therefore triggers all kinds of message processing downstream, where also memory operations commonly happen.</div>
<div style>In this sense, calling sys_domicrosleep at the end of PROCESS does not make the situation worse than it is right now.</div><div style><br></div><div style>gr~~~</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
2013/1/21 Thomas Grill <span dir="ltr"><<a href="mailto:gr@grrrr.org" target="_blank">gr@grrrr.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2013/1/21 <a href="mailto:padawan12@obiwannabe.co.uk" target="_blank">padawan12@obiwannabe.co.uk</a> <span dir="ltr"><<a href="mailto:padawan12@obiwannabe.co.uk" target="_blank">padawan12@obiwannabe.co.uk</a>></span><div>
<div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div><div>
<div>
<br>On 21 January 2013 at 14:57 Thomas Grill <<a href="mailto:gr@grrrr.org" target="_blank">gr@grrrr.org</a>> wrote:
</div>
<div>
<blockquote style="margin-left:0px;padding-left:10px;border-left:solid 1px blue" type="cite">
<div dir="ltr">
<br>
<div>
I am not sure whether using memory management functions in an audio callback is a problem
</div>
</div>
</blockquote>
</div>
</div><p>Yikes!</p>
<p><a href="http://www.rossbencina.com/code/real-time-audio-programming-101-time-waits-for-nothing" target="_blank">http://www.rossbencina.com/code/real-time-audio-programming-101-time-waits-for-nothing</a></p>
</div></blockquote></div></div></div><br>You (and Ross) are certainly right. Someone has to find a better solution, maybe using an extra thread that is signalled by the audio callback. For libpd that should be easier (because it's very clean right now) than for Vanilla Pd.</div>
<div class="im">
<div class="gmail_extra">gr~~~<br clear="all"><div><br></div>-- <br>Thomas Grill<br><a href="http://grrrr.org" target="_blank">http://grrrr.org</a>
</div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Thomas Grill<br><a href="http://grrrr.org">http://grrrr.org</a>
</div>