<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">One quite simple improvement is to
      change the hipe_mfait_lock to be a read-write mutex
      (erts_smp_rwmtx_t).<br>
      And then do read-lock at lookup and exclusive write-lock only when
      inserting a new entry in the table.<br>
      <br>
      I don't think that requires much knowledge about the VM to pull
      off <span class="moz-smiley-s3"><span> ;-) </span></span>.<br>
      <br>
      /Sverker, Erlang/OTP<br>
      <br>
      <br>
      <br>
      On 01/14/2015 12:34 AM, Louis-Philippe Gauthier wrote:<br>
    </div>
    <blockquote
cite="mid:CAGvQrRg1Gc3zhqGikpL3UBV16_hf88FqT9u+Vn7N6Bd4cDVq6w@mail.gmail.com"
      type="cite">
      <pre wrap="">Hi erlang-bugs,
I couple of months ago I tried running our full application using HiPE. I
ran into several issues, some manageable, some not... The most problematic
issue was due to locking, specifically, the hipe_mfait_lock (you can see
the lock counter output in the gist bellow).

<a class="moz-txt-link-freetext" href="https://gist.github.com/lpgauth/2b3220f4bceeed6f62d0">https://gist.github.com/lpgauth/2b3220f4bceeed6f62d0</a>

Looking at the code it's obvious that this is a known problem... the
following comment was added when the lock was added in 2010.

"XXX: Redesign apply et al to avoid those updates."
<a class="moz-txt-link-freetext" href="https://github.com/erlang/otp/blob/maint/erts/emulator/hipe/hipe_bif0.c#L1218">https://github.com/erlang/otp/blob/maint/erts/emulator/hipe/hipe_bif0.c#L1218</a>

Unfortunately, I'm don't know the runtime enough to start patching it... so
instead I'm reporting it.

Thanks,
LP

</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
erlang-bugs mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-bugs@erlang.org">erlang-bugs@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-bugs">http://erlang.org/mailman/listinfo/erlang-bugs</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>