-
Notifications
You must be signed in to change notification settings - Fork 28
Implementation of mechanisms for synchronisation of memory access at the knowledge level #483
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
Draft
IRomanchuk06
wants to merge
52
commits into
ostis-ai:main
Choose a base branch
from
IRomanchuk06:feat/sc_memory_knowledge_sync
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
9d8d7fa
Add minimum classes for sc-transactions implementation (element versi…
IRomanchuk06 bbd5206
Basic structures, transaction_manager init, remove epoch, supplement …
IRomanchuk06 1d0fc23
Add transaction-related methods (.h), use sc_* types
IRomanchuk06 29cd498
Add sc_transaction_clear
IRomanchuk06 84f8bac
Implemented initialization method for the manager and transaction cre…
IRomanchuk06 ba1ff66
Fix link error, correct sc_transaction_manager vars name
IRomanchuk06 6e28a24
Change element version handling
IRomanchuk06 1a5d43d
Upgrade .gitignore
IRomanchuk06 2967adc
Connect txn and buffer, init for buffer
IRomanchuk06 a4df08d
Highlighted 4 types of operation, flags to track sc-element field cha…
IRomanchuk06 c433d47
Tests for buffer (add created element)
IRomanchuk06 06a7dcb
Implementation of transaction_buffer
IRomanchuk06 a418e36
Replace sc_addr pointers with their hash values in lists
IRomanchuk06 5ca1034
Generation of id's for elements versions using monitor_table
IRomanchuk06 c3e7cb1
Refactor
IRomanchuk06 f97767e
Linear version history
IRomanchuk06 fd3440b
Transaction buffer operations, refactor
IRomanchuk06 8e01f63
Add txn buffer tests, format code, refactor
IRomanchuk06 96e1c8f
Fix txn buffer content save, tests for sc_transaction
IRomanchuk06 af0f29a
Tests fix
IRomanchuk06 ae7903c
Transaction manager queue handling
IRomanchuk06 e6e59d8
Use transaction manager as global, transaction queue add, queue handl…
IRomanchuk06 795c295
Add implementation of wrapper methods for managing GThread threads
IRomanchuk06 61b1539
Use wrapper methods for threads in manager
IRomanchuk06 cfd7d8d
External memory allocation for the manager
IRomanchuk06 6cf6c41
Manager ini returns sc_result
IRomanchuk06 90fb0e5
Manager tests
IRomanchuk06 8f972be
Fix txn buffer init and destroy
IRomanchuk06 6143ff4
Rename txn manager, use var for txn id, highligh the methods for the api
IRomanchuk06 63c29a9
Init txn manager with sc-memory
IRomanchuk06 6c0bcee
Update tests
IRomanchuk06 40e6e49
Context is assigned to a transaction, update tests
IRomanchuk06 fbea119
Add example of operation on sc-memory within a transaction
IRomanchuk06 04b869b
Remove redundant flags
IRomanchuk06 2d56991
Use segment for store element version history
IRomanchuk06 7f4f263
Update
IRomanchuk06 271ad88
Add sc_storage_get_element_data_by_addr
IRomanchuk06 21f83c7
Fix cyclic inclusion of file headers
IRomanchuk06 1a46dac
New_elements list in txn_bufer store sc_element_data
IRomanchuk06 9e5440d
Txn use element data copy in operations, new elements created immedia…
IRomanchuk06 37dd131
Base txn operations, tests, correct manager init
IRomanchuk06 a32c7e4
Transaction validation process logic
IRomanchuk06 43a1959
Txn commit logic, fix sc-element init, txn state, add version logic (…
IRomanchuk06 9d6304b
Delete element txn logic, format code
IRomanchuk06 9cc97a1
Add sc_thread_sleep (glib)
IRomanchuk06 2ce15b7
Fix txn_manager init, fix txn validation, rewrite buffer tests, start…
IRomanchuk06 5ce3646
Fix deadlock in txn_handler and intersect
IRomanchuk06 6310a81
Fix monitor lock in txn operation
IRomanchuk06 e71d400
Benchmark tests
IRomanchuk06 0911739
Txn operations return sc_addr
IRomanchuk06 a06434e
[ci] Fix cmake install
NikitaZotov 8d97092
Merge branch 'ostis-ai:main' into feat/sc_memory_knowledge_sync
IRomanchuk06 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| /* | ||
| * This source file is part of an OSTIS project. For the latest info, see http://ostis.net | ||
| * Distributed under the MIT License | ||
| * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT) | ||
| */ | ||
|
|
||
| #include "sc_thread.h" | ||
|
|
||
| #include "sc-core/sc_types.h" | ||
|
|
||
| sc_thread * sc_thread_new(sc_thread_name * name, sc_thread_func func, sc_thread_data data) | ||
| { | ||
| return g_thread_new(name, func, data); | ||
| } | ||
|
|
||
| void sc_thread_join(sc_thread * thread) | ||
| { | ||
| if (thread != null_ptr) | ||
| { | ||
| g_thread_join(thread); | ||
| } | ||
| } | ||
|
|
||
| void sc_thread_unref(sc_thread * thread) | ||
| { | ||
| if (thread != null_ptr) | ||
| { | ||
| g_thread_unref(thread); | ||
| } | ||
| } | ||
|
|
||
| void sc_thread_sleep(sc_uint32 milliseconds) | ||
| { | ||
| g_usleep((gulong)milliseconds * 1000); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
sc-memory/sc-core/src/sc-store/sc-transaction/sc_element_version.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| #include "sc_element_version.h" | ||
|
|
||
| #include "sc-store/sc_version_segment.h" | ||
|
|
||
| #include <sc-core/sc-base/sc_allocator.h> | ||
|
|
||
| sc_element_data * sc_element_data_new() | ||
| { | ||
| return sc_mem_new(sc_element_data, 1); | ||
| } | ||
|
|
||
| sc_element_version * sc_element_create_new_version( | ||
| sc_element const * element, | ||
| sc_element_data const * new_element_data, | ||
| sc_uint64 const transaction_id) | ||
| { | ||
| if (new_element_data == null_ptr) | ||
| return null_ptr; | ||
|
|
||
| sc_element_version * new_version = sc_mem_new(sc_element_version, 1); | ||
| if (new_version == null_ptr) | ||
| return null_ptr; | ||
|
|
||
| new_version->data = new_element_data; | ||
| new_version->transaction_id = transaction_id; | ||
| new_version->version_id = sc_version_segment_get_next_version_id(element); | ||
| new_version->parent_version = element->version_history->current_version; | ||
| new_version->is_committed = SC_FALSE; | ||
|
|
||
| return new_version; | ||
| } |
39 changes: 39 additions & 0 deletions
39
sc-memory/sc-core/src/sc-store/sc-transaction/sc_element_version.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| #ifndef SC_ELEMENT_VERSION_H | ||
| #define SC_ELEMENT_VERSION_H | ||
|
|
||
| #include "sc-core/sc_types.h" | ||
| #include "sc-store/sc_element.h" | ||
|
|
||
| typedef struct sc_element_data | ||
| { | ||
| sc_element_flags flags; | ||
|
|
||
| sc_addr first_out_arc; | ||
| sc_addr first_in_arc; | ||
| #ifdef SC_OPTIMIZE_SEARCHING_INCOMING_CONNECTORS_FROM_STRUCTURES | ||
| sc_addr first_in_arc_from_structure; | ||
| #endif | ||
|
|
||
| sc_arc_info arc; | ||
|
|
||
| sc_uint32 incoming_arcs_count; | ||
| sc_uint32 outgoing_arcs_count; | ||
| } sc_element_data; | ||
|
|
||
| sc_element_data * sc_element_data_new(); | ||
|
|
||
| typedef struct sc_element_version | ||
| { | ||
| sc_element_data const * data; | ||
| sc_uint64 version_id; | ||
| sc_uint64 transaction_id; | ||
| struct sc_element_version * parent_version; | ||
| sc_bool is_committed; // redundant? | ||
| } sc_element_version; | ||
|
|
||
| sc_element_version * sc_element_create_new_version( | ||
| sc_element const * element, | ||
| sc_element_data const * new_element_data, | ||
| sc_uint64 transaction_id); | ||
|
|
||
| #endif |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Quality: .gitignore ignores all .cmake and .tcl files
The new .gitignore rules add blanket
*.cmakeand*.tclpatterns. This will silently ignore legitimately tracked CMake modules/config files (e.g. Find*.cmake, project config templates) across the repo, causing future such files to be missed by git add. Scope these ignores to build directories rather than matching every .cmake/.tcl in the tree.Was this helpful? React with 👍 / 👎