Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Thread optimization issue

Thread optimization issue

Scheduled Pinned Locked Moved 3rd Party Software
1 Posts 1 Posters 740 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RohitIti
    wrote on 10 Sept 2014, 10:15 last edited by
    #1

    Hi guys, i need help in deciding the correct way of managing threads.

    Problem description : I have a xml file containing some messages with id and a cycle time for each message. The cycle time tells at what rate the messages should keep sending. Here lets take the total number of messages as 100. my requirement is that, i will get notification from outside (lets take it as some programme
    triggering the message id) every time i get the message with id from outside i need to search
    for that id in xml file and keep on sending the message to some other class for every cycle time of that message. This can be handled by timer and keep one sending the message.

    but my problem is for every message am creating a new thread and sending which is not good. can some tell me some thread optimization here so that it can be easily handled in later stages also.
    XML File <id>1</id> <msg>hello</msg> <cycle>1000</cycle>

    <id>2</id> <msg>hello Qt</msg> <cycle>1000</cycle> . . . class xmlparser() ———-> reads xml file. class MessageSender() ———-> sends the message to class RecieverMessage. class RecieverMessage() —————> getmessage(id) , recieves the message , searches the id in xmlparser and keep on creating thread and sends the

    [Thread closed. Duplicate of http://qt-project.org/forums/viewthread/47244/ --JKSH]

    1 Reply Last reply
    0

    1/1

    10 Sept 2014, 10:15

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved