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. supporting multithread

supporting multithread

Scheduled Pinned Locked Moved C / C++ / MFC
comtutorial
3 Posts 3 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
    shadrach_india
    wrote on last edited by
    #1

    hi all how to konw that a COM Object support multithread or not thanks shadrach

    P S 2 Replies Last reply
    0
    • S shadrach_india

      hi all how to konw that a COM Object support multithread or not thanks shadrach

      P Offline
      P Offline
      Paul M Watt
      wrote on last edited by
      #2

      Hopefully the writer of the object put the proper restrictions on the object. If it is not multithread aware, then it will only be allowed to be created in a Single Threaded Apartment (STA), then if you try to talk to multiple COM objects on different threads, the COM architecture will protect and syncrhonize those objects. Otherwise, a COM object will be thread safe if it is allowed to run in the Multi-threaded Apartment(MTA) or the Free Threaded Apartment. In this case, the object itself must syncrhonize the internal state data to properly run. When you create a COM object, you specify the type of thread that it is created on. If the thread that you are attempting to create the object on is not compatible with the supported apartment types for the COM object, the object creation should fail.


      Build a man a fire, and he will be warm for a day
      Light a man on fire, and he will be warm for the rest of his life!

      1 Reply Last reply
      0
      • S shadrach_india

        hi all how to konw that a COM Object support multithread or not thanks shadrach

        S Offline
        S Offline
        Stephen Hewitt
        wrote on last edited by
        #3

        In general you should have to worry. As long as you marshal interfaces pointers between threads COM should take care of the details.

        Steve

        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