eclipse-iceoryx / eclipse-iceoryx/iceoryx

Verify that `PointerRepository` does not have to be thread-safe

Open
#1,701 9 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
C++
Stars
2.2k
Forks
492
Avg merge
18h 57m
Merged PRs (30d)
1

Description

## Brief feature description

In a this discussion it was unraveled that the PointerRepository is not-thread-safe: https://github.com/eclipse-iceoryx/iceoryx/pull/1699#discussion_r984338244

@elBoberido drafted the following possible scenario:

* thread A is started
* thread B is started
* thread A registers a pointer
* thread B registers a pointer -> is this a valid use case
* thread B uses a relative pointer -> do we need to sync the memory

Do we require memory synchronizations here or even place some kind of thread-safe mechanism? This has to be investigated further.

In my opinion the drafted scenario is a valid use case but I think that iceoryx does not use the pointer repository in that fashion. A startup looks like:
* runtime registers at roudi
* roudi sends a list with all shared memory segments to the application
* one thread in the application receive this list and registers all segments in the pointer repository
* since the runtime init is the first call threads will start to pop up after the registration is finalized

Furthermore, the pointer repository is an internal construct. So I think that we currently do not have a bug but since the expected behavior differs from the actual one we require a solution for the scenario drafted by @elBoberido . Which includes
* threadsafe pointer registration
* sync between threads

Or we try to avoid this by defining a strict contract. The problem is `unregister`, what happens when a thread unregisters a segment while others are still using them (or the relative pointers on them).

Contributor guide

Open the contributing guide

Research direction

Start with the linked pull-request discussion and trace PointerRepository registration, relative-pointer use, and unregistering across the runtime startup flow. Determine whether the drafted concurrent scenario is valid and whether the work is a thread-safe implementation or a strict usage contract; done means the behavior and synchronization requirements are explicitly resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.