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

AM-75 Implement aquamarine as SOA software #101

Merged
merged 26 commits into from
Sep 23, 2024
Merged

Conversation

MaksymT17
Copy link
Owner

@MaksymT17 MaksymT17 commented Aug 11, 2024

  1. Implement aquamarine as SOA software.
  2. Use shared memory for messaging.
  3. Add the possibility to run multiple client(master) applications. Each client may have its configuration.
  4. Define interface with Message types.
  5. Verify cross-platform build.

ben added 5 commits July 28, 2024 12:37
Applied SOA principle in aquamarine design.
AM starts as a service wich will receive and respond to requestor of comparison.
Am will be running untill DISCONNECT message would be received.
Message flow: HANDSHAKE -> SET_CONFIG -> COMPARE -> .. -> DISCONNECT.

Remove shared_ptr for configuration.
@MaksymT17 MaksymT17 self-assigned this Aug 11, 2024
@MaksymT17 MaksymT17 force-pushed the uninx_shared_mem branch 2 times, most recently from f48bf67 to b2745e7 Compare August 11, 2024 10:27
Copy link

github-actions bot commented Aug 11, 2024

Unit test results

34 tests  +1   34 ✔️ +1   1s ⏱️ ±0s
10 suites +1     0 💤 ±0 
  1 files   ±0     0 ±0 

Results for commit 28403d8. ± Comparison against base commit f2011bf.

♻️ This comment has been updated with latest results.

@MaksymT17 MaksymT17 force-pushed the uninx_shared_mem branch 9 times, most recently from 161b5b9 to a402e7d Compare August 11, 2024 14:08
@MaksymT17
Copy link
Owner Author

Windows build artifacts have not been tested

@MaksymT17 MaksymT17 added the enhancement New feature or request label Aug 11, 2024
@MaksymT17 MaksymT17 force-pushed the uninx_shared_mem branch 2 times, most recently from 3a29d99 to a7656be Compare August 18, 2024 09:11
@MaksymT17 MaksymT17 force-pushed the uninx_shared_mem branch 7 times, most recently from ca2cd2a to 47ca165 Compare September 1, 2024 13:00
@MaksymT17 MaksymT17 force-pushed the uninx_shared_mem branch 2 times, most recently from 4427943 to 42d6416 Compare September 4, 2024 18:34
@MaksymT17 MaksymT17 force-pushed the uninx_shared_mem branch 3 times, most recently from b2a2675 to 927877e Compare September 21, 2024 12:56
@MaksymT17 MaksymT17 changed the title Add shared memory for messaging AM-75 Implement aquamarine as SOA software Sep 23, 2024
@MaksymT17 MaksymT17 merged commit 1b496b7 into master Sep 23, 2024
4 checks passed
Comment on lines +57 to +87
{
printf("compare_ %s %s _\n", messageCompare->base, messageCompare->to_compare);
auto iter = m_connections.processActionUpdate(message);
m_amApi->setConfiguration(iter->configuration); // set configuration for this client
printf("conf pixs %zu\n", iter->configuration.MinPixelsForObject);
am::analyze::algorithm::DescObjects result;
try
{
result = m_amApi->compare(messageCompare->base, messageCompare->to_compare);
}
catch (const am::common::exceptions::AmException exc)
{
std::cout << "Exception has been caught: " << exc.what() << ::std::endl;
Message failed{messageCompare->id, MessageType::COMPARE_FAIL};
m_server->send(&failed);
continue;
}
std::cout << "received after compare\n";
MessageCompareResult compare_result;
compare_result.id = messageCompare->id;

compare_result.payload_bytes = result.size() * sizeof(Rect);
Rect *rects = static_cast<Rect *>(compare_result.payload);
size_t id = 0;
for (auto &rectangle : result)
{
if (id == 100) // limit by 100 objects
{
compare_result.payload_bytes = 100 * sizeof(Rect);
break;
}
Copy link
Owner Author

@MaksymT17 MaksymT17 Sep 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All possible exceptions have to be handled.
An instance of a shared memory сщььгтшсфещк object has to be destroyed to be able to reuse synchronization primitives.
In case of forced termination of aquamarine process such sync primitives could be left in an unknown state and work with mapped memory have to be finalized correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant