HighTechTalks DotNet Forums  

AppDomains and static unmanaged variables

Dotnet Framework (CLR) microsoft.public.dotnet.framework.clr


Discuss AppDomains and static unmanaged variables in the Dotnet Framework (CLR) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Stephen Walch
 
Posts: n/a

Default AppDomains and static unmanaged variables - 10-02-2006 , 08:45 PM






Our application environment consists of three basic layers:

1. Third-party unmanaged DLLs that were written before the CLR was invented
and maintain a significant amount of information (including memory
management and connection pooling constructs) as static variables which were
intended to scoped to the process.

2. Managed C++ assemblies (.NET 1.1) that wrap the unmanaged DLLs as nice
neat classes with managed interfaces.

3. ASP.NET 1.1 applications that call the managed assemblies.

When running just one ASP.NET web app, everything is fine, even with
high-volume multi-threaded access. But introduce a second web app in the
same AppPool, and eventually the state of the unmanaged DLLs in #1 become
corrupted. The only explanation I can come up with is that calling the
unmanaged DLLs from multiple AppDomains is breaking the assumption that the
original developers made that static variable are global to the process.

Is there a good solution to this problem? Perhaps a way to force static
variables to be global in a process again? Or am I misunderstanding what
might be going on?



Reply With Quote
  #2  
Old   
Steven Cheng[MSFT]
 
Posts: n/a

Default RE: AppDomains and static unmanaged variables - 10-03-2006 , 01:45 AM






Hello Stephen,

Welcome to MSDN newsgroup.

I've also found your another thread in the following newsgroup discussing
on the same issue:

microsoft.public.dotnet.framework.aspnet

I've posted my reply and some suggestion there. Please feel free to
followup there if you need any assistance.


Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



This posting is provided "AS IS" with no warranties, and confers no rights.


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.