COM `IStream` interface pointer and access from different threads

Is this an official COM requirement for any implementation IStreamthat it should be thread safe from the point of view of simultaneous access to methods IStreamthrough the same interface pointer over threads?

I'm not talking about data integrity (as a rule, reading / writing / searching should in any case be synchronized with locks). The question is the need to use a COM marshaller to transfer an object IStreamto a stream from another COM apartment.

This is a more general question than I asked how to return , please refer to it for more details. I'm just trying to figure it out better. IStreamCreateStreamOnHGlobal

EDITED , I found this information on MSDN :

Thread safety. The stream created by SHCreateMemStream has been thread safe since Windows 8. On earlier systems, the thread is not thread safe. The stream created by CreateStreamOnHGlobal is thread safe.

Now I believe that the object IStreamreturned CreateStreamOnHGlobalis thread safe , but there is NO requirement that other implementations IStreamshould follow this .

+4
source share
1 answer

, . . . , , , CreateStreamOnHGlobal IStream. . , IStream. .

, , COM, , , , , . , ( ). , , .

, COM .

: http://msdn.microsoft.com/en-us/library/ms809971.aspx

  • , , .
  • .
  • " " -threaded " .

. . , IStream, , . , . - , -, .

. , . , . , , , .

.

CoMarshalInterthreadInterfaceInStream , IStream , CoUnmarshalInterfaceAndReleaseStream.

​​ . , .

- IStream .

.

+1

All Articles