Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
ecbe7c1
start working on MutableSharedBuffer&SharedBufferView
vipalade May 11, 2025
a6ca59c
started working on sharedbufferview
vipalade May 17, 2025
ed629d1
mprpc: WIP - switch to using RingSharedBuffer and MutableSharedBuffer
vipalade Jun 7, 2025
54be9ee
mprpc: fixing issues with moving to ringsharedbuffer
vipalade Jun 9, 2025
eaee2ec
mprpc: small improvements on connection mprpc socket relate
vipalade Jun 14, 2025
626b5c9
some cleanup and keep working on sharedbuffer pool
vipalade Aug 19, 2025
fb7963a
utility: fix intrusive_ptr casting
vipalade Sep 11, 2025
7fce575
adding c++23 support
vipalade Sep 23, 2025
de4b808
workin on performance improvements on: aioreactor, nanotime, threadpool
vipalade Oct 17, 2025
87891ad
working on different improvements
vipalade Oct 19, 2025
64d4d08
keep working on improving both function and aioreactorx
vipalade Oct 25, 2025
576ffbb
utility: function small switch to references to function in rtti
vipalade Oct 25, 2025
c17f0c8
utility: refactor event and any plus experimenting with function impr…
vipalade Oct 30, 2025
6748e87
utility: improve function and clean any code
vipalade Oct 31, 2025
c883094
utility: added anyimpl.hpp
vipalade Nov 1, 2025
672b3bb
utility: no more const_cast on any, event and function + cleanup
vipalade Nov 1, 2025
19dc180
fix some of the warnings on clang on macos
vipalade Nov 1, 2025
ea4e6c6
fix warnings clang and g++
vipalade Nov 2, 2025
533c72f
utility: remove cacheable.hpp
vipalade Nov 16, 2025
402bfaa
modernize function&event&any + function static_assert on big objects
vipalade Nov 18, 2025
f32cdca
function using StoreOption instead of bool
vipalade Nov 19, 2025
e29c342
any using AcceptBigT
vipalade Nov 20, 2025
e17f671
solid/utility: introducing Pool - pool of (Mutable)IntrusivePtrs
vipalade Nov 28, 2025
8d7a967
solid/utility: make Pool noncopyable
vipalade Nov 28, 2025
8f3acc2
solid/utility: fix function
vipalade Nov 29, 2025
c3b92e8
solid/utility: introducing BufferPool
vipalade Nov 29, 2025
a36c827
solid/utility: fix pool
vipalade Nov 29, 2025
9633d65
solid/utility: more fixes on BufferPool
vipalade Nov 29, 2025
8fef5fb
solid/frame/mprpc: using new BufferPool - all tests pass on Linux
vipalade Nov 29, 2025
47d2023
solid/utility: fixes constinstrusiveptr
vipalade Nov 29, 2025
9534eae
solid/serialization: add support for MutableInstrusivePtr and ConstIn…
vipalade Nov 29, 2025
f88e356
solid/frame/mprpc: WIP1 - MessagePtr -> Mutable/ConstMessagePtr
vipalade Nov 29, 2025
f918218
solid/frame/mprpc: updated clientserver tests with new Send/Recv Ptrs
vipalade Dec 2, 2025
f788ae4
solid/frame/mprpc: fixing few more tests
vipalade Dec 3, 2025
df9886c
solid/frame/mprpc: updated all tests examples and tutorials with the …
vipalade Dec 4, 2025
8e14b97
solid/utility: fix tests
vipalade Dec 4, 2025
9153b55
solid/utility: function - added StoreOption as class template paramet…
vipalade Dec 5, 2025
25ae11b
solid/utility: function activate emplace
vipalade Dec 5, 2025
f165f95
fix build windows + fix issue on sharedbuffer double release
vipalade Dec 5, 2025
ec91fc0
reformat
vipalade Dec 5, 2025
bc3f522
solid/utility: add support for StorageOption to Any and Event
vipalade Dec 5, 2025
676a26f
solid: fix build on macos
vipalade Dec 5, 2025
316a3b4
solid/utility: fixes for any
vipalade Dec 6, 2025
11295aa
solid/frame/mprpc: minor changes
vipalade Dec 6, 2025
1c871d9
solid/frame/mprpc: fix infinite loop in messagewriter and added Mutab…
vipalade Dec 11, 2025
e1e4916
solid/utility: reformat
vipalade Dec 11, 2025
b03d768
solid: asan and tsan fixes
vipalade Dec 12, 2025
5441df2
solid/utility/test: reformat
vipalade Dec 12, 2025
4790aa6
version 13.0
vipalade Dec 20, 2025
e09ee30
working on fixing windows git workflow build
vipalade Dec 20, 2025
4b8bd80
keep trying to fix workflow windows build
vipalade Dec 20, 2025
c079520
keep trying to fix macos build on githu workflow
vipalade Dec 20, 2025
e9ef241
keep trying to fix workflow build
vipalade Dec 20, 2025
55a07e1
keep trying to fix workflow build
vipalade Dec 20, 2025
59870a3
bis
vipalade Dec 20, 2025
5805786
bis
vipalade Dec 20, 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
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ modernize-*,\
-modernize-use-noexcept,\
-modernize-use-transparent-functors,\
-modernize-use-using,\
-modernize-use-trailing-return-type,\
performance-*,\
-performance-inefficient-string-concatenation,\
readability-*,\
Expand Down
39 changes: 24 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
#-----------------------------------------------------------------
# The project
#-----------------------------------------------------------------
project (SolidFrame VERSION 12.3)
project (SolidFrame VERSION 13.0)

message("SolidFrame version: ${PROJECT_VERSION} - ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
#-----------------------------------------------------------------
Expand Down Expand Up @@ -33,19 +33,25 @@ find_package(Threads REQUIRED)
#-----------------------------------------------------------------

if(NOT CMAKE_CXX_STANDARD)
file (READ "${CMAKE_CURRENT_SOURCE_DIR}/cmake/check/cpp20.cpp" source_code)
file (READ "${CMAKE_CURRENT_SOURCE_DIR}/cmake/check/cpp23.cpp" source_code)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD 23)
include(CheckCXXSourceCompiles)
CHECK_CXX_SOURCE_COMPILES("${source_code}" SOLID_COMPILE_CXX20)
if(NOT SOLID_COMPILE_CXX20)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
file (READ "${CMAKE_CURRENT_SOURCE_DIR}/cmake/check/cpp17.cpp" source_code)
CHECK_CXX_SOURCE_COMPILES("${source_code}" SOLID_COMPILE_CXX17)

if(NOT SOLID_COMPILE_CXX17)
message(FATAL_ERROR "SolidFrame needs at least CXX17!")
CHECK_CXX_SOURCE_COMPILES("${source_code}" SOLID_COMPILE_CXX23)
if(NOT SOLID_COMPILE_CXX23)
file (READ "${CMAKE_CURRENT_SOURCE_DIR}/cmake/check/cpp20.cpp" source_code)

set(CMAKE_CXX_STANDARD 20)
CHECK_CXX_SOURCE_COMPILES("${source_code}" SOLID_COMPILE_CXX20)
if(NOT SOLID_COMPILE_CXX20)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
file (READ "${CMAKE_CURRENT_SOURCE_DIR}/cmake/check/cpp17.cpp" source_code)
CHECK_CXX_SOURCE_COMPILES("${source_code}" SOLID_COMPILE_CXX17)

if(NOT SOLID_COMPILE_CXX17)
message(FATAL_ERROR "SolidFrame needs at least CXX17!")
endif()
endif()
endif()
endif()
Expand All @@ -64,7 +70,7 @@ message("Install directory: \"${CMAKE_INSTALL_PREFIX}\"")
message("External directory: \"${EXTERNAL_DIR}\"")
message("Fortify: \"${FORTIFY}\"")

list(APPEND CMAKE_PREFIX_PATH ${EXTERNAL_PATH})
list(APPEND CMAKE_PREFIX_PATH ${EXTERNAL_DIR})

#-----------------------------------------------------------------
# Prepare the definitions for build types
Expand Down Expand Up @@ -150,7 +156,6 @@ set(SYSTEM_BASIC_LIBRARIES "")


option(SOLID_FRAME_AIO_REACTOR_USE_SPINLOCK "Use SpinLock on AIO Reactor" ON)
option(SOLID_MPRPC_USE_SHARED_PTR_MESSAGE "Use std::shared_ptr with mprpc::Message" OFF)

#-----------------------------------------------------------------
# Per OS configuration
Expand Down Expand Up @@ -199,6 +204,10 @@ if(CMAKE_SYSTEM MATCHES "Darwin*")
"$<$<CONFIG:MAINTAIN>:SHELL: ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -Wall -Wshorten-64-to-32 -Wunreachable-code -Wconditional-uninitialized -Wabi>"
"$<$<CONFIG:CUSTOM>:>"
)

if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
add_compile_options("-stdlib=libc++")
endif()

string(APPEND CMAKE_EXE_LINKER_FLAGS "-framework ApplicationServices -framework CoreFoundation")

Expand Down Expand Up @@ -328,7 +337,7 @@ if(NOT NO_EXTERNAL)
include_directories(${CMAKE_BINARY_DIR}/external/include)

if(EXTERNAL_DIR STREQUAL "" OR NOT EXISTS ${EXTERNAL_DIR})
set(EXTERNAL_DIR "${CMAKE_CURRENT_BINARY_DIR}/external")
set(EXTERNAL_DIR "${CMAKE_BINARY_DIR}/external")

include(cmake/build-openssl.cmake)
else()
Expand Down
3 changes: 3 additions & 0 deletions JOURNAL.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 20251220
* release 13.0 - breaking changes on mprpc

## 20250119
* release 12.3
* Experimental Mutable/ConstSharedBuffer
Expand Down
12 changes: 12 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# SolidFrame Releases

## Version 13.0
* solid/utility:
* MutableIntrusivePtr, ConstIntrusivePtr
* Pool of MutableIntrusivePtr of Poolable types
* MutableSharedBuffer, ConstSharedBuffer
* BufferPool of MutableSharedBuffers
* solid/frame/aio:
* Reactor improvements
* solid/frame/mprpc:
* breaking change related to write buffer - both the message header and the message chunk should fit in write buffer
* breaking change - switch to using MutableMessagePointer and ConstMessagePointer for Recv and Send messages respectively, in the message callback.

## Version 12.2
* improvements and fixes on reflection
* use std::variant in example_threadpool
Expand Down
2 changes: 1 addition & 1 deletion cmake/build-snappy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ExternalProject_Add(
URL https://github.com/google/snappy/archive/1.1.9.tar.gz
DOWNLOAD_NO_PROGRESS ON
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}/external -DCMAKE_INSTALL_LIBDIR=lib -DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}/external -DCMAKE_INSTALL_LIBDIR=lib -DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF -DCMAKE_POLICY_VERSION_MINIMUM=3.5
LOG_UPDATE ON
LOG_CONFIGURE ON
LOG_BUILD ON
Expand Down
22 changes: 22 additions & 0 deletions cmake/check/cpp23.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include <expected>
#include <print>

using namespace std;

struct base {
template <class Self>
void f(this Self&& self)
{
print("{0}", typeid(Self).name());
}
};

struct derived : base {};

int main()
{
derived my_derived;
my_derived.f();

return 0;
}
2 changes: 0 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ print_usage(){
echo "7) create a debug Ninja build for C++17"
echo "./configure -b debug -e ../external -f debug -g Ninja -P \"-DCMAKE_CXX_STANDARD=17\""
echo
echo "8) create release build with using std::shared_ptr for solid::frame::mprpc::Message"
echo "./configure -f release_sp -e ../external/ -g Ninja -P \"-DSOLID_MPRPC_USE_SHARED_PTR_MESSAGE=on\""
echo
exit
}
Expand Down
2 changes: 1 addition & 1 deletion examples/frame/aio_echo/example_echo_auto_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ frame::aio::Resolver& async_resolver(frame::aio::Resolver* _pres = nullptr)
return r;
}

using CallPoolT = ThreadPool<Function<void()>, Function<void()>>;
using CallPoolT = ThreadPool<Function64T<void()>, Function64T<void()>>;

} // namespace

Expand Down
8 changes: 8 additions & 0 deletions examples/frame/aio_echo/example_secure_echo_client.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#include "solid/utility/common.hpp"

#ifdef SOLID_ON_WINDOWS
#define NOMINMAX
#include <WinSock2.h>
#include <windows.h>
#endif

#include "solid/frame/aio/openssl/aiosecurecontext.hpp"
#include "solid/frame/aio/openssl/aiosecuresocket.hpp"

Expand Down
10 changes: 9 additions & 1 deletion examples/frame/aio_echo/example_secure_echo_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@

*/

#include "solid/utility/common.hpp"

#ifdef SOLID_ON_WINDOWS
#define NOMINMAX
#include <WinSock2.h>
#include <windows.h>
#endif

#include "solid/frame/aio/openssl/aiosecurecontext.hpp"
#include "solid/frame/aio/openssl/aiosecuresocket.hpp"

Expand Down Expand Up @@ -277,7 +285,7 @@ bool parseArguments(Params& _par, int argc, char* argv[])
void Listener::onAccept(frame::aio::ReactorContext& _rctx, SocketDevice& _rsd)
{
solid_log(generic_logger, Info, "");
unsigned repeatcnt = backlog_size();
size_t repeatcnt = backlog_size();

do {
if (!_rctx.error()) {
Expand Down
30 changes: 13 additions & 17 deletions examples/frame/mprpc_echo/example_mprpc_echo.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "solid/frame/mprpc/mprpcmessage.hpp"
#include "solid/frame/mprpc/mprpcsocketstub_openssl.hpp"

#include "solid/frame/manager.hpp"
Expand All @@ -17,6 +18,7 @@
#include "solid/frame/mprpc/mprpcprotocol_serialization_v3.hpp"
#include "solid/frame/mprpc/mprpcservice.hpp"

#include "solid/utility/intrusiveptr.hpp"
#include "solid/utility/threadpool.hpp"

#include "solid/system/socketaddress.hpp"
Expand Down Expand Up @@ -86,11 +88,9 @@ typedef std::vector<MessageStub> MessageVectorT;
struct FirstMessage;

namespace {
mutex mtx;
condition_variable cnd;
Params params;
Params params;

void broadcast_message(frame::mprpc::Service& _rsvc, frame::mprpc::MessagePointerT<>& _rmsgptr);
void broadcast_message(frame::mprpc::Service& _rsvc, frame::mprpc::SendMessagePointerT<> _rmsgptr);
} // namespace

struct FirstMessage : frame::mprpc::Message {
Expand Down Expand Up @@ -191,8 +191,8 @@ int main(int argc, char* argv[])
return 1;
}
} else {
frame::mprpc::MessagePointerT<> msgptr = frame::mprpc::make_message<FirstMessage>(s);
broadcast_message(ipcsvc, msgptr);
frame::mprpc::SendMessagePointerT<FirstMessage> msgptr = frame::mprpc::make_message<FirstMessage>(s);
broadcast_message(ipcsvc, static_pointer_cast<solid::frame::mprpc::Message>(std::move(msgptr)));
}
} while (s.size());
}
Expand All @@ -212,14 +212,14 @@ bool restart(
[&](auto& _rmap) {
_rmap.template registerMessage<FirstMessage>(1, "FirstMessage",
[](
frame::mprpc::ConnectionContext& _rctx,
frame::mprpc::MessagePointerT<FirstMessage>& _rsend_msg,
frame::mprpc::MessagePointerT<FirstMessage>& _rrecv_msg,
ErrorConditionT const& _rerr) {
frame::mprpc::ConnectionContext& _rctx,
frame::mprpc::SendMessagePointerT<FirstMessage>& _rsend_msg,
frame::mprpc::RecvMessagePointerT<FirstMessage>& _rrecv_msg,
ErrorConditionT const& _rerr) {
if (_rrecv_msg) {
solid_log(generic_logger, Info, _rctx.recipientId() << " Message received: is_on_sender: " << _rrecv_msg->isOnSender() << ", is_on_peer: " << _rrecv_msg->isOnPeer() << ", is_back_on_sender: " << _rrecv_msg->isBackOnSender());
if (_rrecv_msg->isOnPeer()) {
_rctx.service().sendResponse(_rctx.recipientId(), _rrecv_msg);
_rctx.service().sendResponse(_rctx.recipientId(), std::move(_rrecv_msg));
} else if (_rrecv_msg->isBackOnSender()) {
cout << "Received from " << _rctx.recipientName() << ": " << _rrecv_msg->str << endl;
}
Expand Down Expand Up @@ -252,16 +252,13 @@ bool restart(
cfg.client.connection_start_fnc = &outgoing_connection_start;
cfg.client.connection_start_state = frame::mprpc::ConnectionState::Active;
cfg.server.connection_start_state = frame::mprpc::ConnectionState::Active;
#if 1

if (params.secure) {
// configure OpenSSL:
solid_log(generic_logger, Info, "Configure SSL ---------------------------------------");
frame::mprpc::openssl::setup_client(
cfg,
[](frame::aio::openssl::Context& _rctx) -> ErrorCodeT {
//_rctx.loadVerifyFile("echo-ca-cert.pem"/*"/etc/pki/tls/certs/ca-bundle.crt"*/);
//_rctx.loadCertificateFile("echo-client-cert.pem");
//_rctx.loadPrivateKeyFile("echo-client-key.pem");
_rctx.addVerifyAuthority(loadFile("echo-ca-cert.pem"));
_rctx.loadCertificate(loadFile("echo-client-cert.pem"));
_rctx.loadPrivateKey(loadFile("echo-client-key.pem"));
Expand All @@ -280,7 +277,6 @@ bool restart(
frame::mprpc::openssl::NameCheckSecureStart{"echo-client"} // does nothing - OpenSSL does not check for hostname on SSL_accept
);
}
#endif

{
frame::mprpc::ServiceStartStatus start_status;
Expand Down Expand Up @@ -341,7 +337,7 @@ std::string loadFile(const char* _path)

namespace {

void broadcast_message(frame::mprpc::Service& _rsvc, frame::mprpc::MessagePointerT<frame::mprpc::Message>& _rmsgptr)
void broadcast_message(frame::mprpc::Service& _rsvc, frame::mprpc::SendMessagePointerT<> _rmsgptr)
{

solid_log(generic_logger, Verbose, "done stop===============================");
Expand Down
2 changes: 1 addition & 1 deletion examples/frame/relay_server/example_relay_server_bi_cp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ bool parseArguments(Params& _par, int argc, char* argv[])
void Listener::onAccept(frame::aio::ReactorContext& _rctx, SocketDevice& _rsd)
{
solid_log(generic_logger, Info, "");
unsigned repeatcnt = SocketInfo::max_listen_backlog_size();
size_t repeatcnt = SocketInfo::max_listen_backlog_size();

do {
if (!_rctx.error()) {
Expand Down
2 changes: 1 addition & 1 deletion examples/utility/algorithm/example_bit_count.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ int main(int argc, char* argv[])
if (argc == 2) {
cout << "Generate table for [0, 255]:" << endl;
cout << '{';
for (size_t i = 0; i < 256; ++i) {
for (uint32_t i = 0; i < 256; ++i) {
if (!(i % 16)) {
cout << endl
<< "\t";
Expand Down
10 changes: 5 additions & 5 deletions examples/utility/memory_file/example_memory_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ int main(int argc, char* argv[])
return 0;
}
cout << "File size: " << fd.size() << endl;
char b[20 * 1024];
int rv;
int rc;
char b[20 * 1024];
ssize_t rv;
ssize_t rc;
do {
rv = 2 * 1024; // randomsize();
// cout<<rv<<endl;
Expand All @@ -66,8 +66,8 @@ int main(int argc, char* argv[])
return 0;
}
mf.seek(0, SeekBeg);
char b[20 * 1024];
int rv, rc;
char b[20 * 1024];
ssize_t rv, rc;
do {
rv = 2 * 1024; // randomsize();
// cout<<rv<<endl;
Expand Down
8 changes: 3 additions & 5 deletions examples/utility/threadpool/example_file_open_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static T align(T _v, const unsigned long _by)
}
}

const uint32_t pagesize = memory_page_size();
const size_t pagesize = memory_page_size();

using FileDeuqeT = std::deque<FileDevice>;

Expand Down Expand Up @@ -111,14 +111,12 @@ int main(int argc, char* argv[])
{1, 100, 0}, [](const size_t, Context&) {}, [](const size_t, Context&) {},
[](FileDevice* _pfile, Context& _rctx) {
int64_t sz = _pfile->size();
int toread;
int cnt = 0;
int64_t toread;
while (sz > 0) {
toread = _rctx.readsz;
if (toread > sz)
toread = sz;
int rv = _pfile->read(_rctx.buf, toread);
cnt += rv;
ssize_t rv = _pfile->read(_rctx.buf, toread);
sz -= rv;
}
},
Expand Down
Loading
Loading