Skip to content

Multithread improvements#205

Merged
pablogs9 merged 12 commits into
galacticfrom
fix/lock_wait_session
Nov 25, 2021
Merged

Multithread improvements#205
pablogs9 merged 12 commits into
galacticfrom
fix/lock_wait_session

Conversation

@pablogs9
Copy link
Copy Markdown
Member

@pablogs9 pablogs9 commented Nov 24, 2021

@pablogs9 pablogs9 requested a review from Acuadros95 November 24, 2021 11:54
Comment thread .github/workflows/ci.yml Outdated
@github-actions
Copy link
Copy Markdown

Static memory analysis

Default configuration

MTU: 512 B
Input buffer size: 2048 B
Input history: 4
Output buffer size: 2048 B
Output history: 4

Entity Qty Size per unit
Context 2 5616 B
Topic 8 56 B
Service 4 248 B
Client 4 248 B
Subscription 4 272 B
Publisher 4 288 B
Node 4 208 B
Static input buffer 8 2136 B
Init options 6 64 B
Wait sets 4 56 B
Guard Condition 4 64 B

TOTAL: 34468 B


// With `rmw_uxrce_wait_mutex` member `need_to_be_ran` is protected.
// `session_memory` itself is not protected because it is not modified between
// rmw_init and rmw_shutdown, and rmw_wait cannot be called concurrently with
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe we should add a multi-thread section to Programming with rcl and rclc or XRCE-Client Documentation to add this guidelines.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Great idea

Comment thread rmw_microxrcedds_c/src/callbacks.c Outdated
Comment thread rmw_microxrcedds_c/src/callbacks.c
Comment thread rmw_microxrcedds_c/src/callbacks.c Outdated
pablogs9 and others added 2 commits November 24, 2021 13:38
Co-authored-by: Antonio Cuadros <49162117+Acuadros95@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

Static memory analysis

Default configuration

MTU: 512 B
Input buffer size: 2048 B
Input history: 4
Output buffer size: 2048 B
Output history: 4

Entity Qty Size per unit
Context 2 5616 B
Topic 8 56 B
Service 4 248 B
Client 4 248 B
Subscription 4 272 B
Publisher 4 288 B
Node 4 208 B
Static input buffer 8 2136 B
Init options 6 64 B
Wait sets 4 56 B
Guard Condition 4 64 B

TOTAL: 34468 B

1 similar comment
@github-actions
Copy link
Copy Markdown

Static memory analysis

Default configuration

MTU: 512 B
Input buffer size: 2048 B
Input history: 4
Output buffer size: 2048 B
Output history: 4

Entity Qty Size per unit
Context 2 5616 B
Topic 8 56 B
Service 4 248 B
Client 4 248 B
Subscription 4 272 B
Publisher 4 288 B
Node 4 208 B
Static input buffer 8 2136 B
Init options 6 64 B
Wait sets 4 56 B
Guard Condition 4 64 B

TOTAL: 34468 B

success = uxr_ping_agent_session(&context->session, timeout_ms, attempts);

item = item->next;
} while (NULL != item && !success);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I still dont like the ping multiple sessions approach.

Maybe we could change this to accept a rmw_context_impl_t as argument? Wich could be NULL.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Don't understand, can you make a proposal?

@github-actions
Copy link
Copy Markdown

Static memory analysis

Default configuration

MTU: 512 B
Input buffer size: 2048 B
Input history: 4
Output buffer size: 2048 B
Output history: 4

Entity Qty Size per unit
Context 2 5616 B
Topic 8 56 B
Service 4 248 B
Client 4 248 B
Subscription 4 272 B
Publisher 4 288 B
Node 4 208 B
Static input buffer 8 2136 B
Init options 6 64 B
Wait sets 4 56 B
Guard Condition 4 64 B

TOTAL: 34468 B

@github-actions
Copy link
Copy Markdown

Static memory analysis

Default configuration

MTU: 512 B
Input buffer size: 2048 B
Input history: 4
Output buffer size: 2048 B
Output history: 4

Entity Qty Size per unit
Context 2 5616 B
Topic 8 56 B
Service 4 248 B
Client 4 248 B
Subscription 4 272 B
Publisher 4 288 B
Node 4 208 B
Static input buffer 8 2136 B
Init options 6 64 B
Wait sets 4 56 B
Guard Condition 4 64 B

TOTAL: 34468 B

@pablogs9 pablogs9 merged commit 5de3d76 into galactic Nov 25, 2021
@pablogs9 pablogs9 deleted the fix/lock_wait_session branch November 25, 2021 15:41
@pablogs9
Copy link
Copy Markdown
Member Author

@mergify backport foxy main

mergify Bot pushed a commit that referenced this pull request Nov 25, 2021
* Minor fixes

* Add rmw_wait mutex

* Protect static_buffer_memory access

* Use new ping API

* Update ci.yml

* Fix

* Fix linter

* Apply suggestions from code review

Co-authored-by: Antonio Cuadros <49162117+Acuadros95@users.noreply.github.com>

* Fix

* Delete old unlock mutex

* Update .github/workflows/ci.yml

Co-authored-by: Antonio Cuadros <49162117+Acuadros95@users.noreply.github.com>
Co-authored-by: Antonio Cuadros <acuadros1995@gmail.com>
(cherry picked from commit 5de3d76)

# Conflicts:
#	.github/workflows/ci.yml
mergify Bot pushed a commit that referenced this pull request Nov 25, 2021
* Minor fixes

* Add rmw_wait mutex

* Protect static_buffer_memory access

* Use new ping API

* Update ci.yml

* Fix

* Fix linter

* Apply suggestions from code review

Co-authored-by: Antonio Cuadros <49162117+Acuadros95@users.noreply.github.com>

* Fix

* Delete old unlock mutex

* Update .github/workflows/ci.yml

Co-authored-by: Antonio Cuadros <49162117+Acuadros95@users.noreply.github.com>
Co-authored-by: Antonio Cuadros <acuadros1995@gmail.com>
(cherry picked from commit 5de3d76)

# Conflicts:
#	.github/workflows/ci.yml
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Nov 25, 2021

backport foxy main

✅ Backports have been created

Details

Hey, I reacted but my real name is @Mergifyio

pablogs9 added a commit that referenced this pull request Nov 25, 2021
* Multithread improvements (#205)

* Minor fixes

* Add rmw_wait mutex

* Protect static_buffer_memory access

* Use new ping API

* Update ci.yml

* Fix

* Fix linter

* Apply suggestions from code review

Co-authored-by: Antonio Cuadros <49162117+Acuadros95@users.noreply.github.com>

* Fix

* Delete old unlock mutex

* Update .github/workflows/ci.yml

Co-authored-by: Antonio Cuadros <49162117+Acuadros95@users.noreply.github.com>
Co-authored-by: Antonio Cuadros <acuadros1995@gmail.com>
(cherry picked from commit 5de3d76)

# Conflicts:
#	.github/workflows/ci.yml

* Resolve conflicts

Signed-off-by: Pablo Garrido <pablogs9@gmail.com>

Co-authored-by: Pablo Garrido <pablogs9@gmail.com>
pablogs9 added a commit that referenced this pull request Nov 25, 2021
* Multithread improvements (#205)

* Minor fixes

* Add rmw_wait mutex

* Protect static_buffer_memory access

* Use new ping API

* Update ci.yml

* Fix

* Fix linter

* Apply suggestions from code review

Co-authored-by: Antonio Cuadros <49162117+Acuadros95@users.noreply.github.com>

* Fix

* Delete old unlock mutex

* Update .github/workflows/ci.yml

Co-authored-by: Antonio Cuadros <49162117+Acuadros95@users.noreply.github.com>
Co-authored-by: Antonio Cuadros <acuadros1995@gmail.com>
(cherry picked from commit 5de3d76)

# Conflicts:
#	.github/workflows/ci.yml

* Resolve conflicts

Signed-off-by: Pablo Garrido <pablogs9@gmail.com>

Co-authored-by: Pablo Garrido <pablogs9@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants