<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Apr 26, 2016 at 1:30 AM, James Aimonetti <span dir="ltr"><<a href="mailto:james@2600hz.com" target="_blank">james@2600hz.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
The curious bit that I can't really figure out is the<br>
{current_function, {ets,delete_trap,1}} bit from the process_info/1<br>
call (output below). As far as I can tell, that is buried in the VM's<br>
C code.<br>
<br></blockquote><div><br></div><div>The delete_trap function is used when you are calling either ets:select_delete/2 or ets:delete/1 on a table with many many elements.</div><div><br></div><div>When working with ets tables that have many elements, erts takes smaller chunks of the table at a time and reschedules the process doing the processing.</div><div><br></div><div>So for ets:delete it would first delete the first X elements (calling delete), then reschedule, then delete the next X (calling delete_trap), and so on deleting X records per iteration. Most ets functions work this way in order to not hog the schedulers for too a long time when working with large tables.</div><div><br></div><div>Lukas</div></div></div></div>