<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.5pt;
        font-family:Consolas;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:Consolas;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoPlainText">Mothy,<o:p></o:p></p>
<p class="MsoPlainText">&nbsp;&nbsp; Thanks for the detailed explanation. For our example, I can have two threads within one core needing to setup communication. Using your binding protocol, one thread will register a connection name and the other will do a blocking
 lookup until that name is registered. Since I&#8217;m using a single lock per core, if the blocking call executes first it will hold the lock while it is waiting and when the register thread tries to acquire the lock it will also wait causing a deadlock (the name
 will never be registered).<o:p></o:p></p>
<p class="MsoPlainText"><o:p>&nbsp;</o:p></p>
<p class="MsoPlainText"><o:p>&nbsp;</o:p></p>
<p class="MsoPlainText">&gt;&gt;Dear Mark,<o:p></o:p></p>
<p class="MsoPlainText">&gt;&gt;<o:p>&nbsp;</o:p></p>
<p class="MsoPlainText">&gt;&gt;You're right that a multithreaded environment is the common case.&nbsp; With Barrelfish, the interface to remote servers &gt;&gt;started as a pure message-passing one, with RPC semantics being added later.&nbsp; An early decision was to avoid adding
 &gt;&gt;thread safety to a particular message-passing channel for efficiency reasons; for many use-cases (including &gt;&gt;multithreaded ones) this makes sense.&nbsp; In the case of the nameserver, it's not ideal.<o:p></o:p></p>
<p class="MsoPlainText">&gt;&gt;<o:p>&nbsp;</o:p></p>
<p class="MsoPlainText">&gt;&gt;For some of our remote services (such as the memory server), all the RPC calls are wrapped inside a client-side &gt;&gt;library, where we can hide the
<o:p></o:p></p>
<p class="MsoPlainText">&gt;&gt;locking from the user.&nbsp;&nbsp; In the case of the nameserver, we don't, but
<o:p></o:p></p>
<p class="MsoPlainText">&gt;&gt;clearly we should...<o:p></o:p></p>
<p class="MsoPlainText">&gt;&gt;<o:p>&nbsp;</o:p></p>
<p class="MsoPlainText">&gt;&gt;One alternative implementation (which we don't have right now) would be to allow lots of outstanding RPCs over a &gt;&gt;single channel, and then dynamically match replies to waiting threads when they arrive.&nbsp; This would require an &gt;&gt;additional
 level of accounting not provided by current Barrelfish waitsets (which, like Unix file descriptor sets, &gt;&gt;allow you wait on channels but not specific messages), but for RPC-style interactions might be a better model.<o:p></o:p></p>
<p class="MsoPlainText">&gt;&gt;<o:p>&nbsp;</o:p></p>
<p class="MsoPlainText">&gt;&gt;That said, I'm still not sure why you could not use a blocking call to
<o:p></o:p></p>
<p class="MsoPlainText">&gt;&gt;the nameserver.&nbsp;&nbsp; If the nameserver channel binding is protected by a
<o:p></o:p></p>
<p class="MsoPlainText">&gt;&gt;client-side lock, you would only see deadlock if you needed to receive (and reply to) an asynchronous message from the &gt;&gt;nameserver before it would return, but I'm not sure I understand your use case in sufficient detail.<o:p></o:p></p>
<p class="MsoPlainText">&gt;&gt;<o:p>&nbsp;</o:p></p>
<p class="MsoPlainText">&gt;&gt;&nbsp; -- Mothy<o:p></o:p></p>
<p class="MsoNormal">&gt;&gt;<o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Mark Brown<o:p></o:p></p>
<p class="MsoNormal">Huawei Technologies Inc.<o:p></o:p></p>
<p class="MsoNormal">5340 Legacy Dr., Suite 175<o:p></o:p></p>
<p class="MsoNormal">Plano, TX 75024<o:p></o:p></p>
<p class="MsoNormal">Tel: 469-277-5700 x5870<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</body>
</html>