Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read-only base AtomSpace, with a read-write overlay. #1895

Merged
merged 28 commits into from
Nov 5, 2018
Merged

Conversation

linas
Copy link
Member

@linas linas commented Nov 5, 2018

This is a basic implementation of a solution for issue #1855. This allows user to create a base atomspace that acts as a cache of atoms from a database, and mark it read-only. An overlay atomspace can be use with this, and atoms can be modified in the overlay. If an attempt is made to set a truth value (or a generic value) on an atom in the read-only base space, it is automatically copied into the overlay space, where the value can be changed. The atom in the base space is left untouched.

Basic example in examples/atomspace/copy-on-write.scm. It works. Includes unit tests.

Note also: even though an atomspace is marked "read-only", one can still fetch from the database, and also extract atoms from the atomspace, thus allowing RAM usage to be managed, without altering the read-only nature of the data in the database.

@bgoertzel
Copy link
Contributor

bgoertzel commented Nov 5, 2018 via email

@linas linas merged commit 6902447 into opencog:master Nov 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants