Thread: Increase Message Queue Size

  1. #1
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158

    Increase Message Queue Size

    Is there a way I can tell Windows to expand the message queue stack size?
    Basicly, I'm getting so many messages posted to this one thread's queue that the handler can't process them fast enough, and some messages end up getting dumped. I need Windows to increase the size of that specific message queue. Is it even possible?
    I know someone might ask me, "If the handler is falling behind what would increasing the queue size do other than prolong it's life?"; the answer would be that the overflow of messages occure in spruts, so the handler does would/does catch up with time.
    I thought of increasing that thread's processor priority, but that wouldn't help becuase it's laging due to hardware communication, not processor over working.
    Also, I don't have control of the program sending the messages, and I can't do any asyncrones operations either, the handler has to stay in service during the whole process.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    >> it's laging due to hardware communication
    More details?

    >> I don't have control of the program sending the messages
    So there's an external program putting message into your message Q?

    gg

  3. #3
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Perhaps you can make your own longer queue - like you have a high priority thread that receives messages, then puts them in an internal queue (assuming you can't deal immediately with the message) that gets sent out again at a slower rate.

    Of course, this does assume that you will eventually catch up.

    I feel this is a better solution than to increase some other queue in the system that you have no control over.

    Having your own queue handling also allows you to filter/drop messages AS YOU WISH rather than the message getting dropped/lost at random when the message queue is full.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  4. #4
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    Yeah, I'll just go ahead and do that.
    Thanks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help creating Message Queue
    By trlpkguy in forum C Programming
    Replies: 5
    Last Post: 10-30-2006, 06:51 PM
  2. increase array size?
    By rodrigorules in forum C Programming
    Replies: 3
    Last Post: 09-18-2005, 12:15 PM
  3. Increase Font Size Or Bold???
    By stickman in forum C++ Programming
    Replies: 10
    Last Post: 08-27-2004, 05:26 PM
  4. help with queues
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 05-21-2002, 09:09 PM
  5. queue help
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 10-29-2001, 09:38 AM