Multithreading

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • developing
    New Member
    • Mar 2007
    • 110

    Multithreading

    What do you preferred for multithreading? .NET or C++?

    i am doing a report on the caveats/advantages; any platforms for comparison? ideas? comments?
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    There is no threading in C++ all threading is provided by 3rd party libraries such as

    Boost
    .NET
    QT

    And normally those rely on the underlying threading mechanism of the OS on which they are running (Windows or Linux for example).

    Comment

    • developing
      New Member
      • Mar 2007
      • 110

      #3
      yes, true...

      but, for example, in .NET all you have to do is start the thread and termination and resource reclamation is handled by the framework

      any ideas for platforms for comparisons?

      Comment

      • Banfa
        Recognized Expert Expert
        • Feb 2006
        • 9067

        #4
        That is true of many multi-threading environments.

        What really counts is the task/thread scheduling algorithm that is used by the system, that is how the system manages threads once they are created not how you create (or clean up after) them.

        Comment

        • johny10151981
          Top Contributor
          • Jan 2010
          • 1059

          #5
          There is no threading in C++ all threading is provided by 3rd party libraries such as

          Boost
          .NET
          QT
          Hi Banfa,
          I really didnt understand what you meant by that. Can you give any link or suggestion that can help to understand your comments...

          regards
          johny

          Comment

          • Banfa
            Recognized Expert Expert
            • Feb 2006
            • 9067

            #6
            C++ is a standard for the language and language syntax and the standard libraries.

            The standard libraries include the C standard library and the STL.

            No-where with-in the C or C++ standard is there any specification for any sort of threading, there can't be because C and C++ are designed to be used on such a wide range of platforms that it is not possible to specify a multi-threading standard that you could be sure could be implemented on all platforms.

            Instead every platform provides its own threading library as appropriate, there is pthreads in Linux and the Windows kernel contains threading available through the WIN32 API, the .NET platform also provides a threading API. Additionally there are plenty of other libraries Boost, QT that provide a threading interface to the underlying threading capabilities of the platform. Many embedded platforms natively have no multi-threading for these there are libraries that implement threading such as vxWorks, ThreadX, uCOS.

            The point is that all of these are either provided by a third party or the platform (that effectively is a third party too), the first and second parties being the C or C++ standard and the programmer.

            So C++ does not support threading, it is supported by many platforms and/or third party libraries but if you want to use multi-threading in your program asking what multi-threading is available is C++ is unless because the answer is none. You need to ask what multi-threading libraries are provided by the manufacturers of the platform I am using and if the answer is none then do any third parties support a multi-threading library for this platform.

            Comment

            • johny10151981
              Top Contributor
              • Jan 2010
              • 1059

              #7
              Thanks Banfa, Its clear...

              regards
              johny

              Comment

              Working...