Hi, Andrew, thanks for you reply. <div><br></div><div>Your explanation on IDC design philosophy quite make sense in that the communication becomes more controllable and predicable. However, will this on sacrifice of performance? I mean, I&#39;ll get message only when the polling thread got run, which is decided by the scheduler. So will this cause extra latency ?<br>

<div><br></div><div>I raise this question because I&#39;m developing a library on Barrelfish that relies heavily on inter-core communication. </div><div>And I worried that polling events will caused performance degradation. But this just a guess, I plan to conduct some</div>

<div>benchmark to dig out more.</div><div><br></div><div>Also thanks for the reminder that binding operations are not thread-safe. I&#39;ve noticed that and now I do all the binding stuff (export, bind, send and recv) only in the polling thread, avoiding potential race.</div>

<div><br></div><div>BTW, I also find your slides on IDC in 2010 Barrelfish workshop very helpful. Thanks for your efforts.<br><br>Regards,</div><div>Jinghao</div><div><br><div class="gmail_quote">2012/3/15 Baumann  Andrew <span dir="ltr">&lt;<a href="mailto:andrewb@inf.ethz.ch">andrewb@inf.ethz.ch</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-AU" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Hi,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Barrelfish/Flounder IDC is asynchronous, but it is not concurrent. Unless you create a pool of threads that call event_dispatch() (which is what you seem to
 have done), there is no other thread that will execute the callbacks for you. This is by design – you shouldn’t be forced to deal with non-deterministic concurrency just to get the benefits of asynchronous messaging.<u></u><u></u></span></p>


<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Note that if you do want the concurrency of multiple threads, the onus is on you to correctly serialise their operations when they interact with shared state
 such as the binding objects. The binding operations (i.e. message send, receive, etc.) are not thread-safe.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Andrew<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> Shi Jinghao (</span><span lang="ZH-CN" style="font-size:10.0pt">史经浩)</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">
 [mailto:<a href="mailto:jhshi@cs.hku.hk" target="_blank">jhshi@cs.hku.hk</a>] <br>
<b>Sent:</b> Wednesday, 14 March, 2012 7:14<br>
<b>To:</b> <a href="mailto:barrelfish-users@lists.inf.ethz.ch" target="_blank">barrelfish-users@lists.inf.ethz.ch</a><br>
<b>Subject:</b> [Barrelfish-users] Questions about IDC: Poll or Interrupt<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I am recently working with IDC in Barrelfish, using the API generated by Flounder. I found that I need <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">to use a separate polling thread to poll the waitset, so that my call backs can get called. <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">For example, when sending a message:  dummy__msg_tx(binding, MKCONT(send_cb, NULL), value)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Since the send is asynchronous, I can continue to do other stuff after this call. However, I expect that<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">my send_cb will be called (*interrupt*) once the send is success, which is not the case:  I must manually poll the <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">binding&#39;s waitset using event_dispatch to get send_cb get called.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I now use a separate polling thread to do all this stuff and it works. But I was wondering:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">    - Is it designed as this way? Or I don&#39;t actually need to poll, just I don&#39;t know how...<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">    - If this is the way as designed, then why? This seems not that &quot;event-driven&quot;, right?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks for your reading and forgive me if I asked a stupid question.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Regards,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Jinghao<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>

</blockquote></div><br></div></div>