<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jun 14, 2014 at 1:04 PM, Tony Rogvall <span dir="ltr"><<a href="mailto:tony@rogvall.se" target="_blank">tony@rogvall.se</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">It is one queue per listen socket, using poll/select.<div><br></div><div>The gen_tcp accept is executed directly in the callers scheduler/thread </div>
<div>if the socket accept returns ok.</div><div>Otherwise the listen socket is "selected" and an input ready callback will </div><div>run socket accept from a scheduler/thread when the event is triggered.</div>
<div>
<br></div><div>So the answer is no. The queued accepts are executed as result of</div><div>the (listen) port being scheduled. The listen port actually creates </div><div>new port / socket and pass that to the process that called gen_tcp accept</div>
<div>in the first place.</div><div><br></div><div>While browsing the code, needed to updated myself with the latest progress, </div><div>in order to reply to this question, I notice that all accepts are executed</div><div>
from the queue regardless how long the queue is. Could this not</div><div>lead to very interesting behavior in extreme cases ?</div><div>(I need to do some fun experiments)</div><div><br></div><div>/Tony</div><div><br></div>
</div></blockquote><div><br></div><div>make sens thanks for the answer! Also thanks to Max :)</div><div><br></div><div>- benoit</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div></div><div><div><div><div><div class="h5"><div>On 14 jun 2014, at 10:30, Benoit Chesneau <<a href="mailto:bchesneau@gmail.com" target="_blank">bchesneau@gmail.com</a>> wrote:</div>
<br></div></div><blockquote type="cite"><div><div class="h5"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jun 14, 2014 at 10:25 AM, Benoit Chesneau <span dir="ltr"><<a href="mailto:bchesneau@gmail.com" target="_blank">bchesneau@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jun 14, 2014 at 9:59 AM, Max Lapshin <span dir="ltr"><<a href="mailto:max.lapshin@gmail.com" target="_blank">max.lapshin@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">Driver remembers what processes have asked to notify them about new connection.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">When new client comes, driver looks for next waiting process, send message to it and removes his record from list of waiting processes.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">So, nothing magic. Driver is single threaded, but it is scheduled independently from other processes.</div></div>
</blockquote></div><br></div></div></div><div class="gmail_extra">So afaik accepting is only done in one thread right? </div></div></blockquote><div><br></div><div>hrmm or does it notify them about a read event and let them accept? </div>
</div></div></div></div></div>
_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br><a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br><div>
<span style="border-collapse:separate;border-spacing:0px"><div><span style="color:rgb(51,51,51);font-family:Geneva,Arial,Helvetica,sans-serif;font-size:12px">"Installing applications can lead to corruption over time. </span><span style="color:rgb(51,51,51);font-family:Geneva,Arial,Helvetica,sans-serif;font-size:12px">Applications gradually write over each other's libraries, partial upgrades occur, user and system errors happen, and minute changes may be unnoticeable and difficult to fix"</span></div>
<div><span style="color:rgb(51,51,51);font-family:Geneva,Arial,Helvetica,sans-serif;font-size:12px"><br></span></div></span><br>
</div>
<br></div></div></div></blockquote></div><br></div><div class="gmail_extra"><br></div></div>