See the thread "Do static ctors guard against concurrent execution?" on the
DOTNET mailing list. It demonstrated .cctor deadlock victims in C#.


Richard

> -----Original Message-----
> From: Moderated discussion of advanced .NET topics.
> [mailto:[EMAIL PROTECTED]]On Behalf Of Stefan
> Avramtchev
> Sent: 18 June 2002 13:47
> To: [EMAIL PROTECTED]
> Subject: Re: [ADVANCED-DOTNET] Singleton pattern
>
>
> I think the type contructors is thread safe.
>
> How otherwise is the framework guarding this rule if not by locking some
> internal object (not the being-initialised class ofcourse) in order to
> guarantee that only one thread runs inside the type contructor?
>
>
> stef
>
>
> On Fri, 14 Jun 2002 15:01:22 -0700, Keith Hill <[EMAIL PROTECTED]>
> wrote:
>
> >>> >"The static constructor for a class executes at most one
> time during a
> >>> >single program instantiation"
> >
> >The more I think about it, the statement above does not imply thread-
> >safety, at least not to me.  Can someone confirm that static constructors
> >are indeed thread-safe?
> >
> >--
> >Keith
> >
>
> You can read messages from the Advanced DOTNET archive,
> unsubscribe from Advanced DOTNET, or
> subscribe to other DevelopMentor lists at http://discuss.develop.com.
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.370 / Virus Database: 205 - Release Date: 05/06/2002
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.370 / Virus Database: 205 - Release Date: 05/06/2002

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to