Hi
I have a COM object written in C#, which I'm having trouble with.
It is a database access library which is being called from unmanaged
C++.
Unfortunately, I don't seem to be able to call multiple instances of the
object from within a multi-threaded C++ app.
Only one thread appears to work with the others failing.
I don't seem to be able to find any info. on MTA for C# objects.
However, I seem to remember reading that C# COM objects are by default
MTA.
Thanks in advance.
Sharanga Dayananda
Dave Purrington - 08 Dec 2003 18:54 GMT
Have you designed your object to be threadsafe?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/c
pconthreadingdesignguidelines.asp
Even if you don't have synchronization issues in your own code, it says
this:
"the .NET Framework class libraries are not thread safe by default"
I think the fact that the other threads are "failing" is an indication that
your object is in actuality executing in a MT environment. Otherwise,
they'd queue up to execute serially.
Hope this helps.
D
> Hi
>
[quoted text clipped - 14 lines]
> Thanks in advance.
> Sharanga Dayananda
Sharanga Dayananda - 09 Dec 2003 09:11 GMT
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/c
pconthreadingdesignguidelines.asp
No, my db lib isn't thread safe.
Thanks.
Sharanga