473,395 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Thread safety when subclassing the Page class

Hi all,

I've declared a class called SecurePage that inherits from the Page class
provided by the framework.

In this class I've declared a protected member called sessionState and a
method called loadSessionState(). loadSessionState initialises the
sessionState object when it's called.

My question is, seeing as the member variable sessionState is declared
globally at the top of SecurePage, do i need to worry about threads or is
the variable isolated per every request?

Thanks all

tce
Nov 19 '05 #1
2 961
There is an instance of the SecurePage class (and this the variable)
for every request, so this will be thread safe.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 10 Dec 2004 12:21:46 -0000, "thechaosengine"
<sh856531@microsofts_free_email_service.com> wrote:
Hi all,

I've declared a class called SecurePage that inherits from the Page class
provided by the framework.

In this class I've declared a protected member called sessionState and a
method called loadSessionState(). loadSessionState initialises the
sessionState object when it's called.

My question is, seeing as the member variable sessionState is declared
globally at the top of SecurePage, do i need to worry about threads or is
the variable isolated per every request?

Thanks all

tce


Nov 19 '05 #2
Should have read:

There is an instance of the SecurePage class (and THUS the variable)
for every request, so this will be thread safe.

I'm having real problems with basic communication skills this morning,
apologies.

--
Scott
http://www.OdeToCode.com/blogs/scott/
On Fri, 10 Dec 2004 09:17:38 -0500, Scott Allen
<bitmask@[nospam].fred.net> wrote:
There is an instance of the SecurePage class (and this the variable)
for every request, so this will be thread safe.


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jonathan Burd | last post by:
Greetings everyone, Here is a random string generator I wrote for an application and I'm wondering about the thread-safety of this function. I was told using static and global variables cause...
4
by: | last post by:
I find in the documentation the following Thread Safety Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not...
4
by: Simo | last post by:
hello, can anyone please tell me if the following structure is thread safe visit.cs class Visit : System.Web.UI.Page { //Variables IVisitProtocol m_oVisitProtocol public void...
7
by: Chad Zalkin | last post by:
We are evaluating some old code that was written as part of our math library. This code uses some optimizations that I'm not sure are necessary or safe, but is a source of debate between my...
11
by: D | last post by:
I have a client application that I want (behind the scenes) to check and make sure a remote host is up (i.e. by ping or TCP connect). I'm assuming that, since I want this to go on "unknowingly" to...
6
by: fniles | last post by:
I am using VB.NET 2003 and a socket control to receive and sending data to clients. As I receive data in 1 thread, I put it into an arraylist, and then I remove the data from arraylist and send it...
7
by: intrader | last post by:
I have the following small classes: //----------------code--------------- using System; using System.Collections.Generic; using System.Text; namespace ValidatorsLibrary { public class...
10
by: Paul | last post by:
Hi all, All of the classes in my DAL are static, with constants defining the stored procedures and parameters. I've been having some problems with my site which makes me wonder if there's a...
13
by: Henri.Chinasque | last post by:
Hi all, I am wondering about thread safety and member variables. If I have such a class: class foo { private float m_floater = 0.0; public void bar(){ m_floater = true; }
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.