<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none"><!--P{margin-top:0;margin-bottom:0;} .ms-cui-menu {background-color:#ffffff;border:1px rgb(171, 171, 171) solid;font-family:'Segoe UI WPC', 'Segoe UI', Tahoma, 'Microsoft Sans Serif', Verdana, sans-serif;font-size:11pt;color:rgb(51, 51, 51);} .ms-cui-menusection-title {display:none;} .ms-cui-ctl {vertical-align:text-top;text-decoration:none;color:rgb(51, 51, 51);} .ms-cui-ctl-on {background-color:rgb(223, 237, 250);opacity: 0.8;} .ms-cui-img-cont-float {display:inline-block;margin-top:2px} .ms-cui-smenu-inner {padding-top:0px;} .ms-owa-paste-option-icon {margin: 2px 4px 0px 4px;vertical-align:sub;padding-bottom: 2px;display:inline-block;} .ms-rtePasteFlyout-option:hover {background-color:rgb(223, 237, 250) !important;opacity:1 !important;} .ms-rtePasteFlyout-option {padding:8px 4px 8px 4px;outline:none;} .ms-cui-menusection {float:left; width:85px;height:24px;overflow:hidden}.wf {speak:none; font-weight:normal; font-variant:normal; text-transform:none; -webkit-font-smoothing:antialiased; vertical-align:middle; display:inline-block;}.wf-family-owa {font-family:'o365Icons'}@font-face {  font-family:'o365IconsIE8';  src:url('prem/15.0.913.22/resources/styles/office365icons.ie8.eot?#iefix') format('embedded-opentype'),         url('prem/15.0.913.22/resources/styles/office365icons.ie8.woff') format('woff'),         url('prem/15.0.913.22/resources/styles/office365icons.ie8.ttf') format('truetype');  font-weight:normal;  font-style:normal;}@font-face {  font-family:'o365IconsMouse';  src:url('prem/15.0.913.22/resources/styles/office365icons.mouse.eot?#iefix') format('embedded-opentype'),         url('prem/15.0.913.22/resources/styles/office365icons.mouse.woff') format('woff'),         url('prem/15.0.913.22/resources/styles/office365icons.mouse.ttf') format('truetype');  font-weight:normal;  font-style:normal;}.wf-family-owa {font-family:'o365IconsMouse'}.ie8 .wf-family-owa {font-family:'o365IconsIE8'}.ie8 .wf-owa-play-large:before {content:'\e254';}.notIE8 .wf-owa-play-large:before {content:'\e054';}.ie8 .wf-owa-play-large {color:#FFFFFF/*$WFWhiteColor*/;}.notIE8 .wf-owa-play-large {border-color:#FFFFFF/*$WFWhiteColor*/; width:1.4em; height:1.4em; border-width:.1em; border-style:solid; border-radius:.8em; text-align:center; box-sizing:border-box; -moz-box-sizing:border-box; padding:0.1em; color:#FFFFFF/*$WFWhiteColor*/;}.ie8 .wf-size-play-large {width:40px; height:40px; font-size:30px}.notIE8 .wf-size-play-large {width:40px; height:40px; font-size:30px}--></style>
</head>
<body dir="ltr">
<div style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Dear Max, et al,<br>
</p>
<p><br>
</p>
<p>Here's hoping either you are still on the mailing list, or the address I found on your website (which says you're a Ph.D. student, so it's starting to smell) is still operational.</p>
<p><br>
</p>
<p>I'm working on redoing some Unique-stuff in GHC. Mostly, the code uses Unique's API in a well-behaved fashion. The only awkward bit I found is in <span style="font-size: 12pt;">BinIface.getSymtabName, which git blames you for ;)</span></p>
<p><span style="font-size: 12pt;"><br>
</span></p>
<p><span style="font-size: 12pt;">I just wanted to ask: Why does this functions do all the bit-masking and shifting stuff directly and with different masks than anything in Unique? Is there a reason why this doesn't use unpkUnique? The comments in Unique state
 that mkUnique is NOT EXPORTED (the caps are in the comments, I'm not shouting), but they are, it seems, specifically for BinIface. I would like to get rid of this, but dare not hack away in the dark.</span></p>
<p><span style="font-size: 12pt;"><br>
</span></p>
<p><span style="font-size: 12pt;">Regards,</span></p>
<p><span style="font-size: 12pt;">Philip</span></p>
<p><br>
</p>
<p><br>
<br>
</p>
<div style="color: rgb(40, 40, 40);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Alexander Kjeldaas <alexander.kjeldaas@gmail.com><br>
<b>Sent:</b> 20 August 2014 15:48<br>
<b>To:</b> Holzenspies, P.K.F. (EWI)<br>
<b>Cc:</b> Simon Peyton Jones; ghc-devs<br>
<b>Subject:</b> Re: Unique as special boxing type & hidden constructors</font>
<div> </div>
</div>
<div>
<div dir="ltr"><br>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Wed, Aug 20, 2014 at 3:07 PM, <span dir="ltr"><<a href="mailto:p.k.f.holzenspies@utwente.nl" target="_blank">p.k.f.holzenspies@utwente.nl</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255); font-family:Calibri,Arial,Helvetica,sans-serif">
<div style="font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255); font-family:Calibri,Arial,Helvetica,sans-serif">
<blockquote style="margin:0px 0px 0px 40px; border:medium none; padding:0px">
<div class="">
<p><span style="color:rgb(40,40,40); font-size:12pt">On Wed, Aug 20, 2014 at 1:47 PM,
</span><span dir="ltr" style="color:rgb(40,40,40); font-size:12pt"><<a href="mailto:p.k.f.holzenspies@utwente.nl" title="mailto:p.k.f.holzenspies@utwente.nl
Ctrl+click or tap to follow link" target="_blank">p.k.f.holzenspies@utwente.nl</a>></span><span style="color:rgb(40,40,40); font-size:12pt">
 wrote:</span></p>
<div style="color:rgb(40,40,40)">
<div>
<div dir="ltr">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255); font-family:Calibri,Arial,Helvetica,sans-serif">
<p><br>
</p>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
<div class="">
<div style="color:rgb(40,40,40)">
<div>
<div dir="ltr">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255); font-family:Calibri,Arial,Helvetica,sans-serif">
<p><thread_id_bits:8> <unique_id_bits:56-X> <tag_bits:X></p>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
<div style="color:rgb(40,40,40)">
<div>
<div dir="ltr">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255); font-family:Calibri,Arial,Helvetica,sans-serif">
<p><br>
</p>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
<div style="color:rgb(40,40,40)">
<div>
<div dir="ltr">
<div class="gmail_quote">
<div><br>
</div>
</div>
</div>
</div>
</div>
<div style="color:rgb(40,40,40)">
<div>
<div dir="ltr">
<div class="gmail_quote">
<div>Is the thread id deterministic between runs?  If not, please do not use this layout.  I remember vaguely Unique being relevant to ghc not having deterministic builds, my most wanted ghc feature:</div>
</div>
</div>
</div>
</div>
<div style="color:rgb(40,40,40)">
<div>
<div dir="ltr">
<div class="gmail_quote">
<div><br>
</div>
</div>
</div>
</div>
</div>
<div style="color:rgb(40,40,40)">
<div>
<div dir="ltr">
<div class="gmail_quote">
<div><a href="https://ghc.haskell.org/trac/ghc/ticket/4012" target="_blank">https://ghc.haskell.org/trac/ghc/ticket/4012</a></div>
</div>
</div>
</div>
</div>
<div style="color:rgb(40,40,40)">
<div>
<div dir="ltr">
<div class="gmail_quote">
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<div style="color:rgb(40,40,40)">
<div>
<div dir="ltr">
<div class="gmail_quote">
<div></div>
<div><br>
</div>
<div>I think this depends on the policy GHC *will* have (there is not parallel build atm) wrt. the forking of threads. An actual Control.Concurrent.ThreadId might be as large as 64 bits, so, of course, we won't be using that, but rather the sequence number
 in which the UniqueSupply was "split off" for a new thread. In other words, if the decision to fork threads is deterministic, so are the Uniques with this layout.<br>
</div>
<div><br>
</div>
<div>Mind you, I imagine a parallel GHC would still have at most one thread working on a single module. I don't know too much about what makes it into the interface file of a module (I can't imagine the exact Uniques end up there, because they would overlap
 with other modules - with per-module compilation - and conflict that way).<br>
</div>
<div><br>
</div>
<div>Can you comment on how (the layout of) Uniques relate to #4012 in a little more detail? It seems that if the Uniques that somehow end up in the interface files could simply be stripped of the thread id, in which case, the problem reduces to the current
 one.<br>
</div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>I frankly don't know.  I just think it's better to keep ThreadId out of data that can bleed into symbols and what not.<br>
<br>
</div>
<div>As you can see, the thread id is just a counter, and as forkIO in a threaded runtime will be racy between threads, they aren't deterministic.<br>
</div>
<div><br>
<a href="http://stackoverflow.com/questions/24995262/how-can-i-build-a-threadid-given-that-i-know-the-actual-number">http://stackoverflow.com/questions/24995262/how-can-i-build-a-threadid-given-that-i-know-the-actual-number</a><br>
<br>
<br>
</div>
<div>Alexander<br>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>