Increase Message Queue Size

This is a discussion on Increase Message Queue Size within the Windows Programming forums, part of the Platform Specific Boards category; Is there a way I can tell Windows to expand the message queue stack size? Basicly, I'm getting so many ...

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

    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.
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,666
    >> 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
    1,616
    Yeah, I'll just go ahead and do that.
    Thanks.
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

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, 05: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, 08:38 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21