Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Threads

Threads

Scheduled Pinned Locked Moved C / C++ / MFC
designquestionlearning
8 Posts 4 Posters 0 Views 1 Watching
  • 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.
  • S Offline
    S Offline
    SatyaDY
    wrote on last edited by
    #1

    Hi, I read in some book, that every modal dialog based application, creates two message loops, one for caller and other for dialog box itself. Is this correct?? If so, how it is implemented?? How many threads (UI or worker) theads does the SDI & MDI application have?? Thanks and Regards, Satya

    P T 2 Replies Last reply
    0
    • S SatyaDY

      Hi, I read in some book, that every modal dialog based application, creates two message loops, one for caller and other for dialog box itself. Is this correct?? If so, how it is implemented?? How many threads (UI or worker) theads does the SDI & MDI application have?? Thanks and Regards, Satya

      P Offline
      P Offline
      Prakash Nadar
      wrote on last edited by
      #2

      From my knowledge and the books that i have read, there is always one message loop / thread. by default there is one thread/sdi or mdi or dialog so only one message loop. worker initially does not have a message loop. Message loop is created dynamically by windows only when that thread needs one.


      MSN Messenger. prakashnadar@msn.com Tip of the day of visual C++ IDE. "We use it before you do! Visual C++ was developed using Visual C++"

      S T 2 Replies Last reply
      0
      • P Prakash Nadar

        From my knowledge and the books that i have read, there is always one message loop / thread. by default there is one thread/sdi or mdi or dialog so only one message loop. worker initially does not have a message loop. Message loop is created dynamically by windows only when that thread needs one.


        MSN Messenger. prakashnadar@msn.com Tip of the day of visual C++ IDE. "We use it before you do! Visual C++ was developed using Visual C++"

        S Offline
        S Offline
        SiddharthAtw
        wrote on last edited by
        #3

        Yes that absoutely correct Mr.Prakash. U don't have to go long way. Just read Threading in Jeffery Richter book. It has all in it. cheers! siddharth

        P 1 Reply Last reply
        0
        • S SiddharthAtw

          Yes that absoutely correct Mr.Prakash. U don't have to go long way. Just read Threading in Jeffery Richter book. It has all in it. cheers! siddharth

          P Offline
          P Offline
          Prakash Nadar
          wrote on last edited by
          #4

          Yeah i have that book :-)


          MSN Messenger. prakashnadar@msn.com Tip of the day of visual C++ IDE. "We use it before you do! Visual C++ was developed using Visual C++"

          1 Reply Last reply
          0
          • S SatyaDY

            Hi, I read in some book, that every modal dialog based application, creates two message loops, one for caller and other for dialog box itself. Is this correct?? If so, how it is implemented?? How many threads (UI or worker) theads does the SDI & MDI application have?? Thanks and Regards, Satya

            T Offline
            T Offline
            Tim Smith
            wrote on last edited by
            #5

            You can have as many message loops in your thread as you wish. I commonly have three or four. Another question is how many message queues can a thread have. The answer to that is only one. When you display a dialog (using standard Windows), it uses it's own internal message loop to process the message while your main application has the primary message loop used for normal processing. Often, when an application needs to process messages during an operation that will take a lot of time, another message loop is used to pump the messages from the message queue. So as you can see, you can have many message loops. But you usually only worry about the primary message loop. Tim Smith I'm going to patent thought. I have yet to see any prior art.

            S 1 Reply Last reply
            0
            • P Prakash Nadar

              From my knowledge and the books that i have read, there is always one message loop / thread. by default there is one thread/sdi or mdi or dialog so only one message loop. worker initially does not have a message loop. Message loop is created dynamically by windows only when that thread needs one.


              MSN Messenger. prakashnadar@msn.com Tip of the day of visual C++ IDE. "We use it before you do! Visual C++ was developed using Visual C++"

              T Offline
              T Offline
              Tim Smith
              wrote on last edited by
              #6

              What you said is true for message queues, not message loops. You can have many message loops. Each thread can only have one message queue. Tim Smith I'm going to patent thought. I have yet to see any prior art.

              P 1 Reply Last reply
              0
              • T Tim Smith

                What you said is true for message queues, not message loops. You can have many message loops. Each thread can only have one message queue. Tim Smith I'm going to patent thought. I have yet to see any prior art.

                P Offline
                P Offline
                Prakash Nadar
                wrote on last edited by
                #7

                yeah, in my application also there is one main message loop and few other make shift message loop.


                MSN Messenger. prakashnadar@msn.com Tip of the day of visual C++ IDE. "We use it before you do! Visual C++ was developed using Visual C++"

                1 Reply Last reply
                0
                • T Tim Smith

                  You can have as many message loops in your thread as you wish. I commonly have three or four. Another question is how many message queues can a thread have. The answer to that is only one. When you display a dialog (using standard Windows), it uses it's own internal message loop to process the message while your main application has the primary message loop used for normal processing. Often, when an application needs to process messages during an operation that will take a lot of time, another message loop is used to pump the messages from the message queue. So as you can see, you can have many message loops. But you usually only worry about the primary message loop. Tim Smith I'm going to patent thought. I have yet to see any prior art.

                  S Offline
                  S Offline
                  SatyaDY
                  wrote on last edited by
                  #8

                  When you display a dialog (using standard Windows), it uses it's own internal message loop to process the message while your main application has the primary message loop used for normal processing. Hi Tim, Is this the case with both Modal and Modeless Dialog Boxes ?? How it is actually implemented?? What are the classes involved in doing this?? How we can create multiple message loops and link them with the application. Regards Satya

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups