Results 1 to 8 of 8

Thread: Threads + Synlock + Buffers

Threaded View

  1. #8
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,598

    Re: Threads + Synlock + Buffers

    Its not so much the number of message types, but the net frequency of the messages being received.

    The fact is, that while I have used the two thread process for receiving messages in one thread, and processing them in another, most of the time that is unnecessary.
    The majority of the time, I have the receiving thread just examine the header of the message to identify the message type then using a case statement or number of If ElseIf blocks, parses the simple messages and stores the data, or for more complex messages calls a parse routine provided by a class that handles that message type.
    After the message is parsed and global values updated, the thread just loops back up to read the next message.

    The receiving thread processing the message read should be able to handle 500 simple messages per second with no problem, and probably handle more than 3000 per second without too much latency.
    If you have less than 500 messages per second to process, you could probably skip the concurrent queues and just process the messages in the receiver as you receive them.
    Since the receiver is in a background thread it won't be hung by things going on in the GUI, likewise the GUI won't be hung up by the receiver.
    Last edited by passel; Oct 3rd, 2016 at 01:32 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width