<div><div dir="auto">Hey Dmytro</div></div><div dir="auto"><br></div><div dir="auto">So no matter if receiving process exists or not, those 100000000 messages have to be copied on the sender’s heap until next garbage collection is performed? Did I get it correctly?</div><div dir="auto"><br></div><div dir="auto">/Frank</div><div dir="auto"><br></div><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>1. A lookup of the process is performed in the dictionary of all pids.</div><div>2. Having null result, the message is dropped (and remains in sender's heap until the next garbage collection)</div><div><br></div><div>There should be no side effect other than the cost of locking/unlocking processes dict for that lookup.</div><div>Sudden process registration should from that moment have all messages copied into the receiving heap, one copy per send, creating 100000000 copies on the receiver heap.<br></div><br></div><br><div class="gmail_quote"></div><div class="gmail_quote"><div dir="ltr" class="m_6384728603119187112gmail_attr">On Fri, 25 Jan 2019 at 15:50, Frank Muller <<a href="mailto:frank.muller.erl@gmail.com" target="_blank">frank.muller.erl@gmail.com</a>> wrote:<br></div></div><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"></blockquote></div><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"><span style="font-family:UICTFontTextStyleBody;font-size:17px">Hey guys</span><br style="font-family:UICTFontTextStyleBody;font-size:17px"><span style="font-family:UICTFontTextStyleBody;font-size:17px"></span><br style="font-family:UICTFontTextStyleBody;font-size:17px"><span><div dir="auto" style="font-family:UICTFontTextStyleBody;font-size:17px">Is there any side effect of sending an infinite stream of messages to a non-existing process registered by name?</div><div dir="auto" style="font-family:UICTFontTextStyleBody;font-size:17px"><br></div><div dir="auto" style="font-family:UICTFontTextStyleBody;font-size:17px">Ex.</div><div dir="auto"><font face="UICTFontTextStyleBody"><span style="font-size:17px">1> </span></font><span style="font-family:-apple-system,HelveticaNeue;font-size:16px">Term = ….</span></div><div dir="auto">2> register(foo, self()).</div><div dir="auto">3> 1 / 0.</div><div dir="auto">4> [ foo ! Term || _ <- lists:eq(1. <a href="tel:10000000000000" dir="ltr" target="_blank">10000000000000</a>) ].</div></span><span style="font-family:UICTFontTextStyleBody;font-size:17px"></span><br style="font-family:UICTFontTextStyleBody;font-size:17px"><span style="font-family:UICTFontTextStyleBody;font-size:17px">I’m curious about how the VM handles this scenario internally:</span><div dir="auto"><br style="font-family:UICTFontTextStyleBody;font-size:17px"><span style="font-family:UICTFontTextStyleBody;font-size:17px">1. messages are simply discarded? And if this the case, will this hurt the VM’s performances?</span><br style="font-family:UICTFontTextStyleBody;font-size:17px"><span style="font-family:UICTFontTextStyleBody;font-size:17px">2. something else???</span><br style="font-family:UICTFontTextStyleBody;font-size:17px"><span style="font-family:UICTFontTextStyleBody;font-size:17px"></span><br style="font-family:UICTFontTextStyleBody;font-size:17px"><span style="font-family:UICTFontTextStyleBody;font-size:17px">Finally, what will happen if during the sending, a process get registered with name 'foo' ? </span><br style="font-family:UICTFontTextStyleBody;font-size:17px"><span style="font-family:UICTFontTextStyleBody;font-size:17px"></span><br style="font-family:UICTFontTextStyleBody;font-size:17px"><span style="font-family:UICTFontTextStyleBody;font-size:17px">Thanks in advance</span><br style="font-family:UICTFontTextStyleBody;font-size:17px"><span style="font-family:UICTFontTextStyleBody;font-size:17px">/Frank</span></div></blockquote></div><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">
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div>
</blockquote></div></div>