supporting multithread
-
hi all how to konw that a COM Object support multithread or not thanks shadrach
-
hi all how to konw that a COM Object support multithread or not thanks shadrach
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! -
hi all how to konw that a COM Object support multithread or not thanks shadrach
In general you should have to worry. As long as you marshal interfaces pointers between threads COM should take care of the details.
Steve