Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
9d8d7fa
Add minimum classes for sc-transactions implementation (element versi…
IRomanchuk06 Mar 22, 2025
bbd5206
Basic structures, transaction_manager init, remove epoch, supplement …
IRomanchuk06 Mar 23, 2025
1d0fc23
Add transaction-related methods (.h), use sc_* types
IRomanchuk06 Mar 24, 2025
29cd498
Add sc_transaction_clear
IRomanchuk06 Mar 24, 2025
84f8bac
Implemented initialization method for the manager and transaction cre…
IRomanchuk06 Mar 24, 2025
ba1ff66
Fix link error, correct sc_transaction_manager vars name
IRomanchuk06 Mar 25, 2025
6e28a24
Change element version handling
IRomanchuk06 Mar 25, 2025
1a5d43d
Upgrade .gitignore
IRomanchuk06 Mar 25, 2025
2967adc
Connect txn and buffer, init for buffer
IRomanchuk06 Mar 25, 2025
a4df08d
Highlighted 4 types of operation, flags to track sc-element field cha…
IRomanchuk06 Mar 26, 2025
c433d47
Tests for buffer (add created element)
IRomanchuk06 Mar 26, 2025
06a7dcb
Implementation of transaction_buffer
IRomanchuk06 Mar 28, 2025
a418e36
Replace sc_addr pointers with their hash values in lists
IRomanchuk06 Mar 30, 2025
5ca1034
Generation of id's for elements versions using monitor_table
IRomanchuk06 Mar 30, 2025
c3e7cb1
Refactor
IRomanchuk06 Mar 30, 2025
f97767e
Linear version history
IRomanchuk06 Apr 3, 2025
fd3440b
Transaction buffer operations, refactor
IRomanchuk06 Apr 3, 2025
8e01f63
Add txn buffer tests, format code, refactor
IRomanchuk06 Apr 5, 2025
96e1c8f
Fix txn buffer content save, tests for sc_transaction
IRomanchuk06 Apr 5, 2025
af0f29a
Tests fix
IRomanchuk06 Apr 9, 2025
ae7903c
Transaction manager queue handling
IRomanchuk06 Apr 9, 2025
e6e59d8
Use transaction manager as global, transaction queue add, queue handl…
IRomanchuk06 Apr 10, 2025
795c295
Add implementation of wrapper methods for managing GThread threads
IRomanchuk06 Apr 10, 2025
61b1539
Use wrapper methods for threads in manager
IRomanchuk06 Apr 10, 2025
cfd7d8d
External memory allocation for the manager
IRomanchuk06 Apr 10, 2025
6cf6c41
Manager ini returns sc_result
IRomanchuk06 Apr 10, 2025
90fb0e5
Manager tests
IRomanchuk06 Apr 10, 2025
8f972be
Fix txn buffer init and destroy
IRomanchuk06 Apr 10, 2025
6143ff4
Rename txn manager, use var for txn id, highligh the methods for the api
IRomanchuk06 Apr 11, 2025
63c29a9
Init txn manager with sc-memory
IRomanchuk06 Apr 11, 2025
6c0bcee
Update tests
IRomanchuk06 Apr 11, 2025
40e6e49
Context is assigned to a transaction, update tests
IRomanchuk06 Apr 11, 2025
fbea119
Add example of operation on sc-memory within a transaction
IRomanchuk06 Apr 11, 2025
04b869b
Remove redundant flags
IRomanchuk06 Apr 16, 2025
2d56991
Use segment for store element version history
IRomanchuk06 May 6, 2025
7f4f263
Update
IRomanchuk06 May 7, 2025
271ad88
Add sc_storage_get_element_data_by_addr
IRomanchuk06 May 7, 2025
21f83c7
Fix cyclic inclusion of file headers
IRomanchuk06 May 7, 2025
1a46dac
New_elements list in txn_bufer store sc_element_data
IRomanchuk06 May 7, 2025
9e5440d
Txn use element data copy in operations, new elements created immedia…
IRomanchuk06 May 8, 2025
37dd131
Base txn operations, tests, correct manager init
IRomanchuk06 May 12, 2025
a32c7e4
Transaction validation process logic
IRomanchuk06 May 12, 2025
43a1959
Txn commit logic, fix sc-element init, txn state, add version logic (…
IRomanchuk06 May 13, 2025
9d6304b
Delete element txn logic, format code
IRomanchuk06 May 13, 2025
9cc97a1
Add sc_thread_sleep (glib)
IRomanchuk06 May 13, 2025
2ce15b7
Fix txn_manager init, fix txn validation, rewrite buffer tests, start…
IRomanchuk06 May 13, 2025
5ce3646
Fix deadlock in txn_handler and intersect
IRomanchuk06 May 14, 2025
6310a81
Fix monitor lock in txn operation
IRomanchuk06 May 14, 2025
e71d400
Benchmark tests
IRomanchuk06 May 15, 2025
0911739
Txn operations return sc_addr
IRomanchuk06 May 20, 2025
8d97092
Merge branch 'ostis-ai:main' into feat/sc_memory_knowledge_sync
IRomanchuk06 Oct 9, 2025
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
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ generated
cmake-build-debug
cmake-build-release
cmake-build-debug-coverage
cmake-build-*
/CMakeUserPresets.json
/ConanPresets.json

Expand Down Expand Up @@ -43,3 +44,14 @@ __pycache__
*.log
*.pdf
*.run.xml

CMakeCache.txt
CMakeFiles/
CPackConfig.cmake
CPackSourceConfig.cmake
CTestTestfile.cmake
DartConfiguration.tcl
Makefile
cmake_install.cmake
*.cmake
*.tcl
35 changes: 35 additions & 0 deletions sc-memory/sc-core/src/sc-store/sc-base/sc_thread.c
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);
}
10 changes: 10 additions & 0 deletions sc-memory/sc-core/src/sc-store/sc-base/sc_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,20 @@
#ifndef _sc_thread_h_
#define _sc_thread_h_

#include "sc-core/sc_types.h"

#include <glib.h>

typedef GThread sc_thread;
typedef gpointer sc_thread_data;
typedef gpointer (*sc_thread_func)(sc_thread_data);
typedef gchar const sc_thread_name;

#define sc_thread_self g_thread_self

sc_thread * sc_thread_new(sc_thread_name * name, sc_thread_func func, sc_thread_data data);
void sc_thread_join(sc_thread * thread);
void sc_thread_unref(sc_thread * thread);
void sc_thread_sleep(sc_uint32 milliseconds);

#endif
31 changes: 31 additions & 0 deletions sc-memory/sc-core/src/sc-store/sc-transaction/sc_element_version.c
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 sc-memory/sc-core/src/sc-store/sc-transaction/sc_element_version.h
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
Loading
Loading