Re: ASP.NET, threading and static member.

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Francois (francois_at_bettinghouses.com_NOSPAM)
Date: 12/20/04


Date: Mon, 20 Dec 2004 18:29:25 +0700

Tx a lot Jon,

Do you know if there is there any way to set some sort of a type value that
will be limited to the scope of a thread only? or is that impossible to do?

Tx in advance and tx again for your answer.

Francois

"Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
news:MPG.1c30aa1740b506d598bae7@msnews.microsoft.com...
> Francois <francois@bettinghouses.com_NOSPAM> wrote:
> > Each time an HTTP request is received by IIS, it forwards it to the
ASP.NET
> > worker process. Then does the ASP.NET worker process in turn start a new
> > thread for each HTTP request it serves (from a pool of thread for
example).
> > Or are all HTTP requests served by the same thread?
>
> I believe they're served by the thread-pool.
>
> > An other question is related to static members. A static member in a
class
> > will have the same value across all its instance.
>
> It's not that it's shared across all instances - it's that the member
> belongs to the type rather than to any instance.
>
> > But for example if 2
> > instances of the class are in 2 different threads, will the static
member
> > still share the value or not? If I remember well, in Java, static member
do
> > not share the same value between different threads and I would like to
know
> > if it is the same thing in C# or not.
>
> It's the same in C# as in Java, but you remember Java incorrectly.
> Static members are shared across threads.
>
> --
> Jon Skeet - <skeet@pobox.com>
> http://www.pobox.com/~skeet
> If replying to the group, please do not mail me too



Relevant Pages

  • Re: Problems with multidimensional arrays and global variables
    ... > Well, I'm not good at Java, learning as I'm going, so this is getting me ... So what am I supposed to do to resolve this? ... static members do not belong to an object. ...
    (comp.lang.java.help)
  • Re: ASP.NET, threading and static member.
    ... >>> Each time an HTTP request is received by IIS, ... >>> An other question is related to static members. ... If I remember well, in Java, static member ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: ASP.NET, threading and static member.
    ... >>> Each time an HTTP request is received by IIS, ... >>> An other question is related to static members. ... If I remember well, in Java, static member ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Static Versus Non Static
    ... understanding of good language design, and particularly of OO programming, ... which gave rise to Java. ... there is a syntax/semantics for refering to static members ... Most Java programmers agree that it is better to pretend that the sharing idea ...
    (comp.lang.java.programmer)
  • Re: Java vs C++
    ... They are different things in Java as well. ... syntax as the recommended way of accessing static members. ... type-safety of container types at compile time instead of waiting until ...
    (comp.lang.java.programmer)