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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Basic Multi thread examples in C++

Basic Multi thread examples in C++

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
8 Posts 6 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.
  • R Offline
    R Offline
    rajeshckk
    wrote on last edited by
    #1

    I need a basic C++ example for the multi threading. I am building up a source code. I have been working on Unix C++ and now need to build up MS windows and as such windows dont support pthread.h, is there an equivalent for it and i can code with it?? Thanks, Rajesh.

    M J D 3 Replies Last reply
    0
    • R rajeshckk

      I need a basic C++ example for the multi threading. I am building up a source code. I have been working on Unix C++ and now need to build up MS windows and as such windows dont support pthread.h, is there an equivalent for it and i can code with it?? Thanks, Rajesh.

      M Offline
      M Offline
      mpk1979
      wrote on last edited by
      #2

      use CreateThread, search google you will be getting lot of samples using this mpk1979

      1 Reply Last reply
      0
      • R rajeshckk

        I need a basic C++ example for the multi threading. I am building up a source code. I have been working on Unix C++ and now need to build up MS windows and as such windows dont support pthread.h, is there an equivalent for it and i can code with it?? Thanks, Rajesh.

        J Offline
        J Offline
        jhwurmbach
        wrote on last edited by
        #3

        rajeshckk wrote:

        C++ example for the multi threading.

        Look at the boost.org[^]-page. Boost is a semi-official enhancement of the C++ runtime environment - full of usefull and high-quality code: They employ a strict peer-review). Here is the link for boost threads[^].


        "We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation." -- Caius Petronius, Roman Consul, 66 A.D.

        S N 2 Replies Last reply
        0
        • J jhwurmbach

          rajeshckk wrote:

          C++ example for the multi threading.

          Look at the boost.org[^]-page. Boost is a semi-official enhancement of the C++ runtime environment - full of usefull and high-quality code: They employ a strict peer-review). Here is the link for boost threads[^].


          "We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation." -- Caius Petronius, Roman Consul, 66 A.D.

          S Offline
          S Offline
          Sceptic Mole
          wrote on last edited by
          #4

          jhwurmbach wrote:

          Look at the boost.org[^]-page. Boost is a semi-official enhancement of the C++ runtime environment - full of usefull and high-quality code

          Boost has no acceptance on the Windows platform.

          J 1 Reply Last reply
          0
          • S Sceptic Mole

            jhwurmbach wrote:

            Look at the boost.org[^]-page. Boost is a semi-official enhancement of the C++ runtime environment - full of usefull and high-quality code

            Boost has no acceptance on the Windows platform.

            J Offline
            J Offline
            jhwurmbach
            wrote on last edited by
            #5

            Sceptic Mole wrote:

            Boost has no acceptance on the Windows platform.

            Where did you get this erroneus information? :confused: Boost is about high-quality standard C++. Not more and not less. And on Windows, quality code is as accepted as anywhere. So is boost. BTW. Big parts of the code now on boost will become official part of the next version of the C++ standard.


            "We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation." -- Caius Petronius, Roman Consul, 66 A.D.

            1 Reply Last reply
            0
            • R rajeshckk

              I need a basic C++ example for the multi threading. I am building up a source code. I have been working on Unix C++ and now need to build up MS windows and as such windows dont support pthread.h, is there an equivalent for it and i can code with it?? Thanks, Rajesh.

              D Offline
              D Offline
              David Crow
              wrote on last edited by
              #6

              See here.


              "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

              "Judge not by the eye but by the heart." - Native American Proverb

              1 Reply Last reply
              0
              • J jhwurmbach

                rajeshckk wrote:

                C++ example for the multi threading.

                Look at the boost.org[^]-page. Boost is a semi-official enhancement of the C++ runtime environment - full of usefull and high-quality code: They employ a strict peer-review). Here is the link for boost threads[^].


                "We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation." -- Caius Petronius, Roman Consul, 66 A.D.

                N Offline
                N Offline
                Nemanja Trifunovic
                wrote on last edited by
                #7

                jhwurmbach wrote:

                Look at the boost.org[^]-page.

                While in general I support using Boost libraries, in this particular case I would advise against it. Boost Threads development seems to be all but dead since the original author left it, and the Standard will probably adopt a different approach.[^]


                Programming Blog utf8-cpp

                J 1 Reply Last reply
                0
                • N Nemanja Trifunovic

                  jhwurmbach wrote:

                  Look at the boost.org[^]-page.

                  While in general I support using Boost libraries, in this particular case I would advise against it. Boost Threads development seems to be all but dead since the original author left it, and the Standard will probably adopt a different approach.[^]


                  Programming Blog utf8-cpp

                  J Offline
                  J Offline
                  jhwurmbach
                  wrote on last edited by
                  #8

                  Nemanja Trifunovic wrote:

                  the Standard will probably adopt a different approach.[^]

                  OK. I did not know that. All I can say is that Boost Threads works flawlessly here in a few projects. It is certainly more complete and of better quality than most of the thread-wrapper classes floating around (and better than anything I could build!)


                  "We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation." -- Caius Petronius, Roman Consul, 66 A.D.

                  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