Thread optimization issue

  • 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 --JKSH]

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.