Re: [ADVANCED-DOTNET] Large structures

2004-05-16 Thread Jeroen Frijters
Arlie Davis wrote: > I have a few questions for the advanced CLR people here. I > haven't been able to find any satisfactory answers elsewhere. > > Consider value types / structures in CLR, and passing them as > arguments to methods. Does the MS CLR *always* copy the entire > structure onto th

Re: [ADVANCED-DOTNET] Large structures

2004-05-16 Thread Thomas Tomiczek
It is a value type. But I think MS assumes that the function calls will be inlined anyway, and the no copy ends up on the stack. Thomas Tomiczek THONA Software & Consulting Ltd. (Microsoft MVP C#/.NET) (CTO PowerNodes Ltd.) > -Original Message- > From: Unmoderated discussion of advanced

Re: [ADVANCED-DOTNET] Large structures

2004-05-16 Thread Shawn A. Van Ness
> This seems like a big waste of time Arlie, are you concerned more about the time (ie, the memcpy operation) or excess growth of the stack (eg, in recursive scenarios)? Or both? I don't have the managed dx sdk handy -- is their Matrix really a valuetype? In System.Drawing.Drawing2D, it's a clas

Re: [ADVANCED-DOTNET] Visibility of an array type and the element type

2004-05-16 Thread Shawn A. Van Ness
> While the implementation is close to what you describe, that > really isn't relevant. I guess I'm a pragmatist, in that I feel like shipped implementations are more relevant than specs. :P Seriously, nice catch. I agree, it does sound like a bug. It'll be interesting to see if this bug gets

[ADVANCED-DOTNET] Thread pool and Lock issue

2004-05-16 Thread Dinesh Ganesan
Hello There, Thank U all previous response regarding the wait on threadpool issue. Now, I am breaking my head , working with thread pooling and locking. Algorithm : 1. StartAF Keep in invoking Collector ( CollectAdapterMessages) 2.CollectAdapterMessages : Create new thread to hand

Re: [ADVANCED-DOTNET] Large structures

2004-05-16 Thread Arlie Davis
Well, I understand all about boxing, and I appreciate the response. But boxing has nothing at all to do with my question. My question is -- what, *exactly*, does the JIT compiler do when it compiles methods that take "large" structures as parameters? Is there a threshold beyond which the JIT com

Re: [ADVANCED-DOTNET] Large structures

2004-05-16 Thread Thomas Tomiczek
Copy, unless the parameter is passed by reference. Thomas Tomiczek THONA Software & Consulting Ltd. (Microsoft MVP C#/.nET) (CTO PowerNodes Ltd.) > -Original Message- > From: Unmoderated discussion of advanced .NET topics. > [mailto:[EMAIL PROTECTED] On Behalf Of Arlie Davis > Sent: Son

Re: [ADVANCED-DOTNET] Large structures

2004-05-16 Thread Vince P
I'm not an expert... BUT.. I think I'm right.. If you're using C#, you can take advantage of boxing which takes a value type and implicitly turns it into a reference type. I dotn know the larger performance/memory implications of this, so the experts will surely give the best practices on this.

[ADVANCED-DOTNET] Large structures

2004-05-16 Thread Arlie Davis
I have a few questions for the advanced CLR people here. I haven't been able to find any satisfactory answers elsewhere. Consider value types / structures in CLR, and passing them as arguments to methods. Does the MS CLR *always* copy the entire structure onto the stack? Or does it ever simply p

Re: [ADVANCED-DOTNET] Visibility of an array type and the element type

2004-05-16 Thread Ilya P. Ryzhenkov
Hi, As far as I know, this is not as simple as it shows up in C#. In CLR there are actually arrays and vectors, two similar but still different concepts. What we are talking here (SomeClass[]) is vector and is handled with special IL commands. For example, newarr creates vector and ldlen gets i

Re: [ADVANCED-DOTNET] Visibility of an array type and the element type

2004-05-16 Thread Jeroen Frijters
I disagree. While the implementation is close to what you describe, that really isn't relevant. In the type system, there really are distinct types for each array type. I would argue that the behavior described by the original poster is in fact a bug. The spec says (part. I 8.5.3.1 Visibility Of T