[erlang-questions] ets:select_delete not atomic?

Oliver Bollmann oliver.bollmann@REDACTED
Mon Aug 12 14:16:52 CEST 2019


Hi, EtsName  = ets:new(test,[named_table,ordered_set]),
Res = ets:select_delete(EtsName,[{{Key},[],[true]}]).

Res should be 1 or 0!

But if i do this with a lot of process, at the same time,
it happend that two process get 1!

Start with: ets:insert(EtsName,{Key}).

Process One: ets:select_delete(EtsName,[{{Key},[],[true]}]).
Process Two: ets:select_delete(EtsName,[{{Key},[],[true]}]).

Process*One **get 1*  AND Process*Two get 1*, with the same key, of course!


Is this correct?

-- 
Grüße
Oliver Bollmann

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20190812/0198b497/attachment.htm>


More information about the erlang-questions mailing list