I don't think what I said is wrong, but it would have been clearer if I
had said: "there is no way (in verifiable code) to pass a reference
between two different threads".

You can consider a reference to be local to a thread. The fact that
there might be two references (in different threads) to the same
location doesn't really change that.

Regards,
Jeroen


> -----Original Message-----
> From: Unmoderated discussion of advanced .NET topics. 
> [mailto:[EMAIL PROTECTED] On Behalf Of Arlie Davis
> Sent: Monday, May 17, 2004 22:24
> To: [EMAIL PROTECTED]
> Subject: Re: [ADVANCED-DOTNET] Large structures
> 
> Almost, but not quite.  Instances of a value type can be 
> hosted within a
> reference type, which is always allocated in the managed 
> heap.  Two threads
> can then access the same instance of a value type at the same time.
> However, nothing horrible can happen.
> 
> -- arlie
> 
> 
> -----Original Message-----
> From: Unmoderated discussion of advanced .NET topics.
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> Jeroen Frijters
> Sent: Monday, May 17, 2004 6:17 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [ADVANCED-DOTNET] Large structures
> 
> John Elliot wrote:
> > Is there any safeguard in place that could catch this type of thing?
> 
> As long as you don't use "unsafe" code, there is no way to 
> get in trouble
> with a ref to a struct (they are always local to one thread).
> Except, of course, by calling a native method that hangs on 
> the pointer.
> 
> Regards,
> Jeroen
> 
> ===================================
> This list is hosted by DevelopMentor.  http://www.develop.com 
> Some .NET
> courses you may be interested in:
> 
> NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
> http://www.develop.com/courses/gaspdotnetls
> 
> View archives and manage your subscription(s) at 
> http://discuss.develop.com
> 
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com
> Some .NET courses you may be interested in:
> 
> NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
> http://www.develop.com/courses/gaspdotnetls
> 
> View archives and manage your subscription(s) at 
> http://discuss.develop.com
> 
> 

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to