<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en" style="--code-editor-font: var(--default-mono-font, "GitLab Mono"), JetBrains Mono, Menlo, DejaVu Sans Mono, Liberation Mono, Consolas, Ubuntu Mono, Courier New, andale mono, lucida console, monospace;">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>
GitLab
</title>
<style data-premailer="ignore" type="text/css">
a { color: #1068bf; }
</style>
<style>img {
max-width: 100%; height: auto;
}
body {
font-size: .875rem;
}
body {
-webkit-text-shadow: rgba(255,255,255,.01) 0 0 1px;
}
body {
font-family: "GitLab Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"; font-size: inherit;
}
</style>
</head>
<body style="font-size: inherit; -webkit-text-shadow: rgba(255,255,255,.01) 0 0 1px; font-family: "GitLab Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";">
<div class="content">
<p style="color: #777777;">
<a href="https://gitlab.rtems.org/Chandanuvm">Chandan U</a>
<a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/3986#note_142101">commented</a>:
</p>
<div class="md" style="position: relative; z-index: 1; color: #3a383f; word-wrap: break-word;">
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">Hello <a href="https://gitlab.rtems.org/gedare" title="Gedare Bloom" class="gfm gfm-project_member js-user-link" data-user="8" data-original="@gedare" data-container="body" data-placement="top" data-reference-type="user" style="color: #284779; background-color: #cbe2f9; border-radius: .25rem; margin-top: 0; padding: 0 2px;">@gedare</a>,</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">I’ve been looking into this issue for gsoc'26 contribution and went through the relevant message queue send paths across Classic, Posix and Score APIs. I wanted to share my current understanding and clarify a few doubts.</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial"><strong style="font-weight: 600; margin-top: 0;">Findings from code study</strong></p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">1. POSIX APIs:-</p>
<ul dir="auto" style="text-align: initial; list-style-type: disc; margin: 0 0 1rem; padding: 0;">
<li style="margin-top: 0; line-height: 1.6em; margin-left: 25px; padding-left: 3px;">mq_send() calls _POSIX_Message_queue_Send_support(), which eventually invokes _CORE_message_queue_Submit().</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">Blocking behavior depends on O_NONBLOCK:</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">If not set wait = true</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">If set wait = false</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">mq_timedsend() also uses _POSIX_Message_queue_Send_support(), but passes a timeout via _Thread_queue_Context_set_timeout_argument() and an enqueue callout for watchdog handling.</li>
</ul>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">So in POSIX, both blocking and timeout paths of _CORE_message_queue_Submit() are used.</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">2. Classic API:-</p>
<ul dir="auto" style="text-align: initial; list-style-type: disc; margin: 0 0 1rem; padding: 0;">
<li style="margin-top: 0; line-height: 1.6em; margin-left: 25px; padding-left: 3px;">rtems_message_queue_send() calls _CORE_message_queue_Send() with wait = false always.</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">_CORE_message_queue_Send() then routes into _CORE_message_queue_Submit() internally, but only the non-blocking path is used since wait = false always.</li>
</ul>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">So Classic send never uses the wait == true path in the CORE layer.</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial"><strong style="font-weight: 600; margin-top: 0;">Observations</strong></p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">From the implementation of _CORE_message_queue_Submit(), there is support for:</p>
<ul dir="auto" style="text-align: initial; list-style-type: disc; margin: 0 0 1rem; padding: 0;">
<li style="margin-top: 0; line-height: 1.6em; margin-left: 25px; padding-left: 3px;">Blocking send</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">Sender wait queues</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">Timeout via thread queue/watchdog (when configured)</li>
</ul>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">However, this capability appears to be used only by POSIX APIs and not exposed through Classic APIs</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial"><strong style="font-weight: 600; margin-top: 0;">Doubts / Questions</strong></p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">1. Was the non-blocking design of rtems_message_queue_send() an intentional Classic API design choice for determinism and simplicity, or is there scope of interest in extending Classic MQs to support blocking/timed send?</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">2. Classic send goes through _CORE_message_queue_Send() rather than calling _CORE_message_queue_Submit() directly like POSIX.</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">Is this layering mainly for API abstraction reasons?</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">I’d appreciate any guidance on whether I’m interpreting the architecture correctly and how this relates to the original issue discussion.</p>
<p dir="auto" style="color: #3a383f; margin: 0;" align="initial">Thanks!</p>
</div>
</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #626168;">
—
<br>
<a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/3986#note_142101">View it on GitLab</a>.
<br>
You're receiving this email because of your account on <a target="_blank" rel="noopener noreferrer" href="https://gitlab.rtems.org">gitlab.rtems.org</a>. <a href="https://gitlab.rtems.org/-/sent_notifications/2-6vt29yj4iymuauxtv25sfxvfy/unsubscribe" target="_blank" rel="noopener noreferrer">Unsubscribe</a> from this thread · <a href="https://gitlab.rtems.org/-/profile/notifications" target="_blank" rel="noopener noreferrer" class="mng-notif-link">Manage all notifications</a> · <a href="https://gitlab.rtems.org/help" target="_blank" rel="noopener noreferrer" class="help-link">Help</a>
<span style="color: transparent; font-size: 0; display: none; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0;">
Notification message regarding https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/3986#note_142101 at 1770441319
</span>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Issue","url":"https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/3986#note_142101"}}</script>
</p>
</div>
</body>
</html>