[erlang-questions] ets unique insert

Chandru <>
Mon Apr 23 12:22:28 CEST 2007


On 23/04/07, Ulf Wiger (TN/EAB) <> wrote:
>
> Chandru wrote:
> >
> > Hello OTP team,
> >
> > It will be nice to have a feature in ETS where for a
> > set/ordered_set table, an object is inserted into the table
> > only if an object with the same key doesn't already exist.
> > Without this feature, a lot of times I find myself writing
> > code where I am accessing a gen_server only to make sure a
> > key hasn't already been used which makes that gen_server
> > process a bottleneck in the system.
> >
> > Is this possible? The operation could probably be called ets:create/2
>
>
> ...or ets:insert_new(Tab, Obj).  (:
>
> See erl -man ets
>

Thanks! I did RTFM but it was the R10B-4 manual. I guess it was
introduced in a later version.

Chandru



More information about the erlang-questions mailing list