<div dir="ltr">HiĀ <span style="font-size:13px">Sverker,</span><div><span style="font-size:13px">That's not a bad idea, I'll try that approach!</span></div><div><span style="font-size:13px"><br></span></div><div><span style="font-size:13px">Thanks,</span></div><div><span style="font-size:13px">LP</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 15, 2015 at 12:27 AM, Sverker Eriksson <span dir="ltr"><<a href="mailto:sverker.eriksson@ericsson.com" target="_blank">sverker.eriksson@ericsson.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div>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><span> ;-) </span></span>.<br>
<br>
/Sverker, Erlang/OTP<div><div class="h5"><br>
<br>
<br>
<br>
On 01/14/2015 12:34 AM, Louis-Philippe Gauthier wrote:<br>
</div></div></div>
<blockquote type="cite"><div><div class="h5">
<pre>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 href="https://gist.github.com/lpgauth/2b3220f4bceeed6f62d0" target="_blank">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 href="https://github.com/erlang/otp/blob/maint/erts/emulator/hipe/hipe_bif0.c#L1218" target="_blank">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></fieldset>
<br>
</div></div><pre>_______________________________________________
erlang-bugs mailing list
<a href="mailto:erlang-bugs@erlang.org" target="_blank">erlang-bugs@erlang.org</a>
<a href="http://erlang.org/mailman/listinfo/erlang-bugs" target="_blank">http://erlang.org/mailman/listinfo/erlang-bugs</a>
</pre>
</blockquote>
<br>
</div>
</blockquote></div><br></div>