Skip to content

[QUESTION] FramedTransport m_sendLock #455

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

Open
djmuhlestein opened this issue Apr 14, 2025 · 2 comments
Open

[QUESTION] FramedTransport m_sendLock #455

djmuhlestein opened this issue Apr 14, 2025 · 2 comments
Labels

Comments

@djmuhlestein
Copy link

For my application I wanted to extend FramedTransport for a custom UART transport. In the Underlying send/receive, I think use the uart hardware similar to the way the uart zephyr transport works. I noticed that m_sendLock is not used in FramedTransport though. The zephyr port doesn't use it either. The only other two classes that do use it are the MUTransport and MBoxTransport but those classes extend Transport directly and have their own m_sendLock.

So, is this an error in FramedTransport? Should I simply Lock m_sendLock in my underlyingSend function or should FramedTransport be patched to correct this. My underlying uart hw is definitely not thread safe.

Copy link

Hi eRPC user. Thank you for your interest and welcome. We hope you will enjoy this framework well.

@amgross
Copy link
Contributor

amgross commented May 11, 2025

Hi @djmuhlestein , sorry for the delay.
The m_sendLock is not in use currently in framed transport because it calls to underlying send just once, and there is an assumption that the underlying send protects itself in case of two threads access it in same time.
You can see that m_receiveLock is in use because it calls underlying receive two time so need to ensure no other thread calls underlying send in middle.
In case your underlying send is not thread safe I suggest you to protect it in this level.

It may be noticed that in simple client there is issue #439 and for arbitrated client there is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants