<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap:break-word"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">Hello,</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">if MAX_SHM_ID is an OS constant, why is it defined in JACK source code then?</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">I understand issues with context switching. But I am designing system that can easily split into multiple machines, so instead of having 1 huge JACK with 100 clients I can have 10 x 10 etc. But still, I need to know what is the limit, and it seem to be quite unknown… I can obviously do crash testing, but I would prefer to rely on certain design principles, no luck that I won’t encounter some hardcoded limits...</div> <div><br></div>Any advice how to compute max number of clients?<div><br></div><div>Any experience about that in practice?</div><div><br> <div id="bloop_sign_1465571310957678080" class="bloop_sign"><div style="font-family:helvetica,arial;font-size:13px">Marcin</div></div> <br><p class="airmail_on">dnia 10 czerwca 2016 o 16:39:17, Paul Davis (<a href="mailto:paul@linuxaudiosystems.com">paul@linuxaudiosystems.com</a>) napisał:</p> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>


<title></title>


<div dir="ltr">
<div>
<div>
<div>
<div>client limits: i will leave the developer(s) of jack2 to
comment on the specifics. jack2 hard-codes more values than
jack1.<br>
<br></div>
the shared memory registry: you can't make its configuration a
run-time thing, because you'd have to ensure that the library and
the server are both given the same value.<br>
<br></div>
MAX_SHM_ID is an operating system constant.<br>
<br></div>
you are hitting the limit almost certainly because you are running
far more clients than JACK was designed to support.<br>
<br></div>
every client with a process callback implies at least 1 extra
context switch during the process cycle. this does not and cannot
scale with contemporary operating systems and processors. context
switches are cheap but not free. doing hundreds of them per process
cycle steals significant amounts of time from what is available for
actual signal processing.<br>
<div>
<div>
<div>
<div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Fri, Jun 10, 2016 at 9:46 AM, <a href="mailto:marcin@saepia.net" target="_blank">marcin@saepia.net</a>
<span dir="ltr"><<a href="mailto:marcin@saepia.net" target="_blank">marcin@saepia.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p dir="ltr">Well I understand but what I observe is that JACK has
unpredictable amount of total clients which is an issue, regardless
if it's closer to 10 than 1000.</p>
<p dir="ltr">I have found out at least 3 conditions that affect
this:</p>
<p dir="ltr">- compilation flags, which by the way may cause jack
to segfault if they are set too high</p>
<p dir="ltr">- parameter to jackd</p>
<p dir="ltr">- MAX_SHM_ID</p>
<p dir="ltr">I suggest integrating this into one runtime command
line parameter.</p>
<p dir="ltr"><span><font color="#888888">M.</font></span></p>
<br></blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</div>


</div></div></span></blockquote></div></body></html>