Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,26 @@ All notable milestones for the nera project are documented in this file.
- Direct compile-error regressions cover `/bitstring-unit:8`, a zero `/bits`
unit and an out-of-range `/bitstring` pattern unit.

## ETS tables survive owner exit through their configured heir

- `ets:new/2` honours `{heir, Pid, GiftData}`: a live heir inherits the
table and its contents before the old owner's `EXIT` or `DOWN` signals,
and receives `{'ETS-TRANSFER', Table, OldOwner, GiftData}`.
- Gift data owns its storage across the creator's garbage collection and
exit. `ets:info/1,2` includes the configured heir, or `none`.
- Tables without an heir, with a dead heir, or with the exiting owner itself
as heir are deleted. Explicit table deletion does not notify the heir.
- The legacy `{heir, Pid}` option transfers without a notification;
`{heir, none}` disables inheritance. Later heir options take precedence.
- `ets_heir` checks named and unnamed tables of all four types, four exit
paths, gift lifetime, manual ownership transfer and concurrent heir exit,
unchanged natively and on BEAM. Changing heirs with `ets:setopts/2`
remains unsupported.

## Process exits release ETS tables before exit signals

- A dead process's ETS tables are deleted before linked processes receive
`EXIT` or monitoring processes receive `DOWN`, as on BEAM. This also covers
- A dead process's ETS tables without a live heir are deleted before linked
processes receive `EXIT` or monitoring processes receive `DOWN`, as on BEAM. This also covers
processes killed by a linked process's exit.
- A child restarted by its supervisor can immediately create the same named
table without racing the previous owner's cleanup.
Expand Down
10 changes: 8 additions & 2 deletions FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ process dictionary under `rand_seed`.

| Function | Status | Notes |
|----------------------|--------|-------------------------------------|
| new/2 | ✅ | `set`, `ordered_set`, `bag`, `duplicate_bag`, `named_table`, `{keypos, N}`; returns the name for a `named_table`, otherwise an integer table identifier (BEAM returns a reference) |
| new/2 | ✅ | `set`, `ordered_set`, `bag`, `duplicate_bag`, `named_table`, `{keypos, N}`, `{heir, Pid, GiftData}`, `{heir, none}`; returns the name for a `named_table`, otherwise an integer table identifier (BEAM returns a reference) |
| insert/2 | ✅ | Single or list of tuples |
| lookup/2 | ✅ | Returns list of matching tuples |
| delete/1 | ✅ | Delete table |
Expand All @@ -527,7 +527,7 @@ process dictionary under `rand_seed`.
| match_object/2 | ✅ | Simple pattern matching |
| select_delete/2 | ✅ | Match spec for conditional delete |
| tab2list/1 | ✅ | |
| info/1,2 | ✅ | `size`, `name`, `type`, `keypos` |
| info/1,2 | ✅ | `size`, `name`, `type`, `keypos`, `owner`, `heir`; `memory` in info/2 |
| update_counter/3 | ✅ | Atomic counter increment (set/ordered_set only) |
| update_element/3 | ✅ | Update tuple element by position (set/ordered_set only) |
| give_away/3 | ✅ | Transfer table ownership |
Expand All @@ -542,6 +542,12 @@ process dictionary under `rand_seed`.
| bag | ✅ | Multiple values per key, no exact duplicates |
| duplicate_bag | ✅ | Multiple values per key, duplicates allowed |

A live configured ETS heir inherits ownership and contents before the old
owner's exit signals, receiving `{'ETS-TRANSFER', Table, OldOwner, GiftData}`.
The legacy `{heir, Pid}` option transfers without a notification. Dead or
self heirs do not preserve a table on owner exit. `ets:setopts/2` is not
implemented.

### timer module

| Function | Status | Notes |
Expand Down
Loading
Loading