Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 48871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:20:52+00:00 2026-05-10T16:20:52+00:00

We have a vxWorks design which requires one task to process messages from two

  • 0

We have a vxWorks design which requires one task to process messages from two message queues, Q1 & Q2.

We would like to wait on both Queues and whichever gets a message, process the message from the queue.

We want to avoid either polling the queues or using a timeout value which could cause the other queue to fill up.

Is there a way to do this?

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T16:20:53+00:00Added an answer on May 10, 2026 at 4:20 pm

    If you use named pipes (pipeDevCreate(), write(), read()) instead of message queues, you can use select() to block until there are messages in either pipe.

    Whenever select() triggers, you process all messages in the high priority pipe. Then you process a single message from the low priority pipe. Then call select again (loop).

    Example Code snippets:

     // Initialization: Create high and low priority named pipes  pipeDrv(); //initialize pipe driver  int fdHi = pipeDevCreate('/pipe/high',numMsgs,msgSize);  int fdLo = pipeDevCreate('/pipe/low',numMsgs,msgSize);   ...   // Message sending thread: Add messages to pipe  write(fdHi, buf, sizeof(buf));   ...   // Message processing Thread: select loop  fd_set rdFdSet;   while(1)  {      FD_ZERO(&rdFdSet);      FD_SET(fdHi, &rdFdSet);      FD_SET(fdLo, &rdFdSet;       if (select(FD_SETSIZE, &rdFdSet, NULL, NULL, NULL) != ERROR)      {          if (FD_ISSET(fdHi, &rdFdSet))          {              // process all high-priority messages              while(read(fdHi,buf,size) > 0)              {                  //process high-priority              }          }           if (FD_ISSET(fdLo, &rdFdSet))          {              // process a single low priority message              if (read(fdLo,buf,size) > 0)              {                  // process low priority              }          }      }  } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If you have round robin enabled in Vxworks and your task gets preempted by
We have two tasks (T1 and T2) in our vxWorks embedded system that have
Have a really weird one here. The app has two targets, just to be
Have a bunch of classes which I need to do serialize and deserialize from/to
If you have round robin scheduling enabled in VxWorks, and you use taskLock() to
I have been unable to receive UDP multicast under VxWorks 5.5. I've joined the
Have you ever seen any of there error messages? -- SQL Server 2000 Could
Have just started using Visual Studio Professional's built-in unit testing features, which as I
Have converted devise new session from erb to Haml but doens't work, this is
have Googled the cr*p out of this one so apologies if the answer is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.