shootout - nsieve-bits benchmark

Matthias Lang matthias@REDACTED
Tue May 2 13:51:29 CEST 2006


Kostis Sagonas writes:

 > I've kept quiet till now, because I did not want to reveal the HiPE
 > magic to the world, 

So, finally, zero-copy message passing is possible in Erlang. I offer
the first example of abuse.

Matthias

----------------------------------------------------------------------

-module(kostis).
-export([go/0]).

go() ->
  Bin = hipe_bifs:bytearray(100, 0),
  spawn(fun() -> wait(Bin) end),
  timer:sleep(5000),
  hipe_bifs:bytearray_update(Bin, 0, 9).

wait(<<9, _/binary>>) -> io:fwrite("got the message\n");
wait(Bin) -> wait(Bin).
  




More information about the erlang-questions mailing list