Search code examples
concurrencyerlangdatastore

DETS concurrency? (Erlang)


I know that ETS has limited concurrency, for instance two writes to the same row at the same time aren't going to collide. But I can't seem to find out this sort of information for DETS. Does anyone know?

Note that I'm not asking about DETS running under the auspices of Mnesia, and I'm not asking about any particular scheme - say assigning a single process per row of the DETS table. I just want to know what the limited concurrency guarantees of DETS are, if any.

Thanks.


Solution

  • As far as I can tell, DETS currently does not support concurrency.

    From the dets manual (my highlights):

    It is worth noting that the ordered_set type present in Ets is not yet implemented by Dets, neither is the limited support for concurrent updates which makes a sequence of first and next calls safe to use on fixed Ets tables. Both these features will be implemented by Dets in a future release of Erlang/OTP. Until then, the Mnesia application (or some user implemented method for locking) has to be used to implement safe concurrency. Currently, no library of Erlang/OTP has support for ordered disk based term storage.