Re: ASP.NET, threading and static member.
From: Francois (francois_at_bettinghouses.com_NOSPAM)
Date: 12/20/04
- Next message: serdar c: "Re: picture baox and counting the black pixels.."
- Previous message: Ravichandran J.V.: "Re: Constructor inheritance (or lack thereof)"
- In reply to: Jon Skeet [C# MVP]: "Re: ASP.NET, threading and static member."
- Next in thread: Daniel Jin: "Re: ASP.NET, threading and static member."
- Reply: Daniel Jin: "Re: ASP.NET, threading and static member."
- Reply: Scott Allen: "Re: ASP.NET, threading and static member."
- Messages sorted by: [ date ] [ thread ]
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
- Next message: serdar c: "Re: picture baox and counting the black pixels.."
- Previous message: Ravichandran J.V.: "Re: Constructor inheritance (or lack thereof)"
- In reply to: Jon Skeet [C# MVP]: "Re: ASP.NET, threading and static member."
- Next in thread: Daniel Jin: "Re: ASP.NET, threading and static member."
- Reply: Daniel Jin: "Re: ASP.NET, threading and static member."
- Reply: Scott Allen: "Re: ASP.NET, threading and static member."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|