HighTechTalks DotNet Forums  

My entire process freezes. - Help.

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


Discuss My entire process freezes. - Help. in the Dotnet Framework (CLR) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #11  
Old   
Willy Denoyette [MVP]
 
Posts: n/a

Default Re: My entire process freezes. - Help. - 03-21-2007 , 05:16 AM






"esafran" <eyal (AT) mokedor (DOT) com> wrote

Quote:
On Mar 20, 3:00 pm, "Ben Voigt" <r... (AT) nospam (DOT) nospam> wrote:
It appears to be a loader lock

Which version of C++.NET are your assemblies? Managed Extensions for C++
(VC2003) has known loader lock bugs that microsoft won't fix. Use C++/CLI
(VC2005) instead.





Eyal Safran.- Hide quoted text -

- Show quoted text -

Do you know if by compiling my Managed C++ dlls in VC2005, but still
in .NET framework 1.1, will solve my loader lock problem?

Eyal Safran.



No, this won't work, if you can't fix the "OS loader lock" issue by one of the resolutions
as mentioned in the article (Initialization of Mixed Assemblies ) pointed to by Ben, then
you are out of luck and you will have to move forward.

Willy.



Reply With Quote
  #12  
Old   
esafran
 
Posts: n/a

Default Re: My entire process freezes. - Help. - 03-21-2007 , 09:38 AM






On Mar 21, 11:16 am, "Willy Denoyette [MVP]"
<willy.denoye... (AT) telenet (DOT) be> wrote:
Quote:
"esafran" <e... (AT) mokedor (DOT) com> wrote in message

news:1174402256.204704.116510 (AT) d57g2000hsg (DOT) googlegroups.com...





On Mar 20, 3:00 pm, "Ben Voigt" <r... (AT) nospam (DOT) nospam> wrote:
It appears to be a loader lock

Which version of C++.NET are your assemblies? Managed Extensions for C++
(VC2003) has known loader lock bugs that microsoft won't fix. Use C++/CLI
(VC2005) instead.

Eyal Safran.- Hide quoted text -

- Show quoted text -

Do you know if by compiling my Managed C++ dlls in VC2005, but still
in .NET framework 1.1, will solve my loader lock problem?

Eyal Safran.

No, this won't work, if you can't fix the "OS loader lock" issue by one of the resolutions
as mentioned in the article (Initialization of Mixed Assemblies ) pointed to by Ben, then
you are out of luck and you will have to move forward.

Willy.- Hide quoted text -

- Show quoted text -
I've found out a scenario where it always hang, and so, i've found a
workaround to it.
The problem is in the order DLLs are being loaded.

Example:
I have a Managed class MBuffer which references to its Unmanaged class
CBuffer

I also have a Managed class MDecoder which references to its Unmanaged
class CDecoder and it references to the unmanaged CBuffer.

MBuffer -> CBuffer
MDecoder -> CDecoder
CDecoder -> CBuffer

now, if the process have loaded the DLLs in the following order, the
process will get stuck:

1) MBuffer
2) CBuffer
3) MDecoder
4) CDecoder

however, if the loading order of the DLLs would have been:
1) MDecoder
2) CDecoder
3) CBuffer
4) MBuffer

the process will never get stuck.

I really don't know why it acts like that.

If you have any idea on how to solve / debug that, that would be
great.
Currently I'm forcing synchronization between the 2 threads with a
static ManualResetEvent, so that the MBuffer DLL will not load untill
its CBuffer DLL will load.

Eyal Safran.



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.