<!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 class="details" style="font-style: italic; color: #626168;">
<a href="https://gitlab.rtems.org/AyahKash">Ayah Kashkoul</a> created a merge request: <a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1098">!1098</a>
</p>
<div class="branch">
Project:Branches: AyahKash/rtems:ayah-psxmsgq-priority-tests to rtems/rtos/rtems:main
</div>
<div class="author">
Author: Ayah Kashkoul
</div>
<div class="assignee">
Assignees:
</div>
<div class="reviewer">
Reviewers:
</div>
<div class="md gl-mt-5" style="position: relative; z-index: 1; color: #3a383f; word-wrap: break-word; margin-top: 1rem;">
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">Depends on: <a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1084" title="Draft: posix: Add mq_ispriority to mq_attr for per‑queue discipline selection" class="gfm gfm-merge_request" data-original="!1084" data-link="false" data-link-reference="false" data-merge-request="2223" data-project="26" data-project-path="rtems/rtos/rtems" data-iid="1084" data-container="body" data-placement="top" data-reference-type="merge_request" style="margin-top: 0;">!1084</a> (adds mq_ispriority_np to mq_attr and selects discipline in mq_open). I’m proposing to keep feature work in <a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1084" title="Draft: posix: Add mq_ispriority to mq_attr for per‑queue discipline selection" class="gfm gfm-merge_request" data-original="!1084" data-link="false" data-link-reference="false" data-merge-request="2223" data-project="26" data-project-path="rtems/rtos/rtems" data-iid="1084" data-container="body" data-placement="top" data-reference-type="merge_request">!1084</a> (Xinhong’s MR) and add these tests so the change is covered by regression tests before merging to main. The test uses semaphores to deterministically control the order threads enter mq_receive(). I ran the test locally on erc32-sis and attached the psxmsgq05.scn.</p>
<h4 id="user-content-summary" dir="auto" style="margin-top: 1rem; margin-bottom: 1rem; font-weight: 600; font-size: 1rem; letter-spacing: inherit; line-height: 1.25; color: #18171d;" align="initial">Summary<a href="#summary" aria-label="Link to heading 'Summary'" data-heading-content="Summary" class="anchor" style="margin-top: 0;"></a>
</h4>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">This MR depends on <a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1084" title="Draft: posix: Add mq_ispriority to mq_attr for per‑queue discipline selection" class="gfm gfm-merge_request" data-original="!1084" data-link="true" data-link-reference="true" data-merge-request="2223" data-project="26" data-project-path="rtems/rtos/rtems" data-iid="1084" data-container="body" data-placement="top" data-reference-type="merge_request" style="margin-top: 0;">!1084</a>. It will fail to build until that MR is merged. This change is for adding a new POSIX message queue test, psxmsgq05, to cover the mq_ispriority_np attribute and the FIFO vs priority wake-up behavior.</p>
<h4 id="user-content-test-logic-2-cases" dir="auto" style="margin-top: 1rem; margin-bottom: 1rem; font-weight: 600; font-size: 1rem; letter-spacing: inherit; line-height: 1.25; color: #18171d;" align="initial">Test Logic (2 Cases)<a href="#test-logic-2-cases" aria-label="Link to heading 'Test Logic (2 Cases)'" data-heading-content="Test Logic (2 Cases)" class="anchor" style="margin-top: 0;"></a>
</h4>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">This MR adds a deterministic regression test suite `psxmsgq05` that verifies:</p>
<ol dir="auto" style="text-align: initial; margin: 0 0 1rem; padding: 0;">
<li style="margin-top: 0; line-height: 1.6em; margin-left: 25px; padding-left: 3px;">
<strong style="font-weight: 600; margin-top: 0;">Default FIFO discipline</strong> (mq_ispriority_np=0): With two threads blocked in mq_receive(), the thread that blocked first receives the message first, regardless of thread priority.</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">
<strong style="font-weight: 600; margin-top: 0;">Opt-in Priority Wakeup discipline</strong> (mq_ispriority_np=1): With two threads blocked in mq_receive(), the higher-priority thread receives the message first, regardless of blocking order.</li>
</ol>
<h4 id="user-content-test-implementation" dir="auto" style="margin-top: 1rem; margin-bottom: 1rem; font-weight: 600; font-size: 1rem; letter-spacing: inherit; line-height: 1.25; color: #18171d;" align="initial">Test Implementation<a href="#test-implementation" aria-label="Link to heading 'Test Implementation'" data-heading-content="Test Implementation" class="anchor" style="margin-top: 0;"></a>
</h4>
<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;">Uses semaphores to control blocking order (low-priority thread blocks first, then high-priority thread).</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">Uses sem_first_done so the main thread waits for the first receiver before sending the second message, avoiding timing-based synchronization. It is better to avoid usleep() for a more deterministic approach that is less reliant on time, especially when used outside a local environment.</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">Uses pthread_mutex for the winner variable</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">Sets thread priorities with PTHREAD_EXPLICIT_SCHED and SCHED_FIFO.</li>
</ul>
<h4 id="user-content-explanation-of-changed-files" dir="auto" style="margin-top: 1rem; margin-bottom: 1rem; font-weight: 600; font-size: 1rem; letter-spacing: inherit; line-height: 1.25; color: #18171d;" align="initial">Explanation of Changed Files<a href="#explanation-of-changed-files" aria-label="Link to heading 'Explanation of Changed Files'" data-heading-content="Explanation of Changed Files" class="anchor" style="margin-top: 0;"></a>
</h4>
<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;">testsuites/psxtests/psxmsgq05/init.c – test implementation is contained here and follows existing patterns</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">testsuites/psxtests/psxmsgq05/psxmsgq05.doc – test description, following existing patterns</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">testsuites/psxtests/psxmsgq05/psxmsgq05.scn – expected output, following existing patterns</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">spec/build/testsuites/psxtests/psxmsgq05.yml – build spec, following existing patterns</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">spec/build/testsuites/psxtests/grp.yml – add psxmsgq05 to build, following existing patterns</li>
</ul>
<h4 id="user-content-important-related-change" dir="auto" style="margin-top: 1rem; margin-bottom: 1rem; font-weight: 600; font-size: 1rem; letter-spacing: inherit; line-height: 1.25; color: #18171d;" align="initial">Important: Related Change<a href="#important-related-change" aria-label="Link to heading 'Important: Related Change'" data-heading-content="Important: Related Change" class="anchor" style="margin-top: 0;"></a>
</h4>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">This test uses the mq_ispriority_np attribute introduced in mqueueopen.c for per-queue FIFO vs priority wake-up discipline in MR <a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1089" title="build: Separate SECTION_FLAGS from OPTIMIZATION_FLAGS" class="gfm gfm-merge_request" data-original="!1089" data-link="false" data-link-reference="false" data-merge-request="2235" data-project="26" data-project-path="rtems/rtos/rtems" data-iid="1089" data-container="body" data-placement="top" data-reference-type="merge_request" style="margin-top: 0;">!1089</a> <a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1084" title="Draft: posix: Add mq_ispriority to mq_attr for per‑queue discipline selection" class="gfm gfm-merge_request" data-original="4" data-link="true" data-link-reference="true" data-merge-request="2223" data-project="26" data-project-path="rtems/rtos/rtems" data-iid="1084" data-container="body" data-placement="top" data-reference-type="merge_request">4</a> (issue <a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/3791" title="POSIX Message Queue thread release order is not priority based" class="gfm gfm-issue" data-original="#3791" data-link="true" data-link-reference="true" data-issue="26273" data-project="26" data-iid="3791" data-namespace-path="rtems/rtos/rtems" data-project-path="rtems/rtos/rtems" data-issue-type="issue" data-container="body" data-placement="top" data-reference-type="issue">#3791</a>) which has not been merged yet. This must be merged in first.</p>
<p dir="auto" style="color: #3a383f; margin: 0 0 1rem;" align="initial">Updates <a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/3791" title="POSIX Message Queue thread release order is not priority based" class="gfm gfm-issue" data-original="#3791" data-link="true" data-link-reference="true" data-issue="26273" data-project="26" data-iid="3791" data-namespace-path="rtems/rtos/rtems" data-project-path="rtems/rtos/rtems" data-issue-type="issue" data-container="body" data-placement="top" data-reference-type="issue" style="margin-top: 0;">#3791</a></p>
<h2 id="user-content-generative-ai" dir="auto" style="margin-top: 20px; margin-bottom: 0;" align="initial">Generative AI<a href="#generative-ai" aria-label="Link to heading 'Generative AI'" data-heading-content="Generative AI" class="anchor" style="margin-top: 0;"></a>
</h2>
</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/-/merge_requests/1098">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-7yrl2fv078dmg4hck0dmgqdit/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/-/merge_requests/1098 at 1772475192
</span>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Merge request","url":"https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1098"}}</script>
</p>
</div>
</body>
</html>