Skip to content

mctp-estack: Don't hold a lock to send messages #51

Draft
mkj wants to merge 2 commits intoCodeConstruct:mainfrom
mkj:pr/no-sender-lock
Draft

mctp-estack: Don't hold a lock to send messages #51
mkj wants to merge 2 commits intoCodeConstruct:mainfrom
mkj:pr/no-sender-lock

Conversation

@mkj
Copy link
Copy Markdown
Member

@mkj mkj commented May 5, 2026

send_message() was holding a blocking lock across the whole
send sequence (until the queue was full). This is currently a
CriticalSectionMutex so would block interrupts.

Instead we can poll until a sender is available. forward_packet() is
now made async. Any waits will be short, until a concurrent
send_message() completes or runs out of queue to copy into.

Helper to implement async locks

Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
@mkj
Copy link
Copy Markdown
Member Author

mkj commented May 5, 2026

Leaving this as Draft until I've tested on real hardware. I'm confident it's correct though.

@mkj mkj force-pushed the pr/no-sender-lock branch from 9cbb8ef to 67e6ee8 Compare May 5, 2026 05:58
send_message() was holding a blocking lock across the whole
send sequence (until the queue was full). This is currently a
CriticalSectionMutex so would block interrupts.

Instead we can poll until a sender is available. forward_packet() is
now made async. Any waits will be short, until a concurrent
send_message() completes or runs out of queue to copy into.

Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
@mkj mkj force-pushed the pr/no-sender-lock branch from 67e6ee8 to 0b1081f Compare May 5, 2026 06:04
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.

1 participant