[erlang-questions] ets:safe_fixtable/2 & ets:tab2file/{2, 3} question

Benoit Chesneau bchesneau@REDACTED
Thu Dec 17 12:34:16 CET 2015


Reading the doc I see that for tables of the ordered_set type,
safe_fixtable/2 is not necessary as calls to first/1 and next/2 will always
succeed.

But what happen when I use `ets:tab2file/2` while keys are continuously
added at the end? When does it stop?

Looking at the source code it seems that it is batching the first 100 keys
to the log file and then run a select until the end:
https://github.com/erlang/otp/blob/maint/lib/stdlib/src/ets.erl#L871-L876

It looks like it can enter in a continuous loop.

What would be the safe way to make a dump of the ets table without entering
in a continuous loop apart locking when reading? Is there any solution
around taking care about that already?

- benoît
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20151217/81731b13/attachment.htm>


More information about the erlang-questions mailing list