Thread local storage...

  • Thread starter Thread starter Atmapuri
  • Start date Start date
A

Atmapuri

Hi!

My dll uses Thread Local Storage because of Open MP.
Is there any workaround on how this dll, can be called from
..NET? What changes would be neccessary?

Will that be addressed in VS2008?

Thanks!
Atmapuri
 
Hello, Atmapuri!

Do you mean that your dll is unmanaged and you want to call it from the
managed application?
Does your dll need to read anything from TLS?

--
With best regards, Vadym Stetsiak.
Blog: http://vadmyst.blogspot.com


You wrote on Wed, 7 Nov 2007 12:33:20 +0100:

A> Hi!

A> My dll uses Thread Local Storage because of Open MP.
A> Is there any workaround on how this dll, can be called from .NET?
A> What changes would be neccessary?

A> Will that be addressed in VS2008?

A> Thanks!
A> Atmapuri
 
You didn't mention you were using __declspec(thread) or threadprivate.

Threadprivate is documented as "You cannot use threadprivate in any DLL that
will be loaded via LoadLibrary" in Visual Studio 2008 and the referenced URL
makes it clear what the problem is.

This is not something that can be addressed in C# or .NET, this is something
that must be addressed by the native C++ compiler, either in the OpenMP
support or what __declspec(thread) does.

If this is an important issue I suggest you contact customer support. If
you want to make a suggestion you can post it to
http://connect.microsoft.com/visualstudio/feedback

--
Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote.
http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#
 
Hi!

It is a very important issue for users of C# and .NET.

It namely limits, the unmanaged code dll's which can be
called from .NET to those which are not internally threaded
with Open MP. Since Open MP is the primary thread
enabling solution supported also by VS.NET C++ and
many other compilers it locks out .NET from apps where
heavy native multi-core support is required.

Regards!
Atmapuri
 
Yes, I understand the issue; but it's an implementation detail of C++ and the
OpenMP support in C++. It affects all languages and frameworks that load a
DLL with the problem via LoadLibrary. There's nothing that can be done on
the C# or .NET side, this is a fundamental change in the C++ compiler on how
it creates thread statics.

--
Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote.
http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top