<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; ">
<span id="OLK_SRC_BODY_SECTION">
<div>
<div>On 6/12/13 7:36 AM, "Marc-Andre Hermanns" <<a href="mailto:m.a.hermanns@grs-sim.de">m.a.hermanns@grs-sim.de</a>> wrote:</div>
</div>
<div><br>
</div>
<blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;">
<div>
<div>
<div>My point here is not that this specific code snippet will deadlock. My</div>
<div>point is more whether overlapping locks with barriers, is a good example </div>
<div>of software engineering and we would like to have people to copy-paste </div>
<div>this style. The focus of the example is on the 'store X' not the </div>
<div>lock/barrier overlap, so the overlap might still be seen as a 'good </div>
<div>thing to do'. Thinking of the philosophers again, I am not so convinced </div>
<div>that this is so.</div>
</div>
</div>
</blockquote>
</span>
<div><br>
</div>
<div>I both agree and disagree with you.  In general, I agree that mixing one-sided and collective synchronization is a horrible programming practice almost certain to lead to deadlock.  However, it's very difficult to discuss many of the synchronization rules
 of MPI one-sided without some outside synchronization object (like MPI_BARRIER) in any formal way.  The examples in Section 11.7 are less about the best way to program one-sided (that's what Section 11.8 is for) and more about clarifying very explicit semantic
 rules in the chapter, so we had to take some liberties with good coding practice in order to raise very specific issues.  Further, the example is explicitly an example of what not to do (in that it may, with separate, deadlock).</div>
<div><br>
</div>
<div>We should probably add a note to that effect around line 43 of page 457 (the start of the semantic examples), but unless you have a better thought on how to raise these issues, I think the text is correct.</div>
<div><br>
</div>
<div>Brian</div>
<div><br>
</div>
<div>
<div>
<div>
<div>
<div style="font-family: Tahoma; font-size: 13px; "><font size="2" face="Tahoma">--</font></div>
<div style="font-family: Tahoma; font-size: 13px; "><font size="2" face="tahoma">  Brian W. Barrett</font></div>
<div style="font-family: Tahoma; font-size: 13px; "><font size="2" face="tahoma">  Scalable System Software Group</font></div>
<div style="font-family: Tahoma; font-size: 13px; "><font size="2" face="tahoma">  Sandia National Laboratories</font></div>
</div>
</div>
</div>
</div>
</body>
</html>