473,396 Members | 1,789 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,396 software developers and data experts.

Class public shared Variables

Posted in asp.net newsgroup, no answer. Hope some experts can help me here

1. Does class shared variable share same feathers as ASP.NET application variable?

2. If it is, it may work better than application variables, because we don't need type conversion

3. Can web farm share same class shared variable? This is not critical for my case, just curious

4. I want to declare a ReaderWriterLock object for thread synchronization, should I declare it as public shared variable in a class, or an application variable

5. If I declare a public variable as Hash Table, I can put all my Thread Related objects into it. So I can create a new Thread, or Abort a thread any time. Is that correct?
Nov 16 '05 #1
1 4834

"Qingdong Z." <an*******@discussions.microsoft.com> wrote in message
news:48**********************************@microsof t.com...
Posted in asp.net newsgroup, no answer. Hope some experts can help me here.
1. Does class shared variable share same feathers as ASP.NET application variable?

Static/Shared variables are shared amongst all instances of the app, session
variables are unique to the session.
2. If it is, it may work better than application variables, because we don't need type conversion.
Memory allocation is also different. However the type of the session
variable is what it is, all you need to do is cast it to its type which
AFAIK isn't resource instensive

3. Can web farm share same class shared variable? This is not critical for my case, just curious.
4. I want to declare a ReaderWriterLock object for thread synchronization, should I declare it as public shared variable in a class, or an application
variable?
5. If I declare a public variable as Hash Table, I can put all my Thread

Related objects into it. So I can create a new Thread, or Abort a thread any
time. Is that correct?
Nov 16 '05 #2

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

Similar topics

8
by: Bryan Parkoff | last post by:
I find an interesting issue that one base class has only one copy for each derived class. It looks like that one base class will be copied into three base classes while derived class from base...
5
by: Chris | last post by:
Hi, I don't get the difference between a struct and a class ! ok, I know that a struct is a value type, the other a reference type, I understand the technical differences between both, but...
3
by: Joe via DotNetMonster.com | last post by:
Hi, How can I declare a variable in a Class so that it can be accessed from the page that calls it? Normally I would declare a variable outside a function so that it can be used globally on the...
8
by: kevin | last post by:
I have a form and in the form I have a sub that uses a class I instantiate using visual basic code: Public oCP As New Rs232 'instantiate the comm port I need to share this sub with...
5
by: Nathan Sokalski | last post by:
I have an array declared as follows: Dim ButtonList() As NavButtonInfo and a Class defined as follows: Public Class NavButtonInfo Public Shared name As String
11
by: dotnetnoob | last post by:
in the old VB, you can use global variables to hold commonly use data. i'll like to pass a variables selected by user in the combobox, how do you hold this variable for other object to use. does...
11
by: Jan | last post by:
Hi, I defined a function like this: Public Function myfunction(ByVal myvar As Object) As String ... Return xyz End Function in aspx file, i use it like this:
18
by: RB | last post by:
Hi guys (and gals!), I've got 2 classes, "TypesafeConstant" and "Color". "Color" inherits from "TypesafeConstant", and adds no new functionality. All "Color" does is to instantiate some class...
5
by: Web Search Store | last post by:
Hello, I made a web page using visual studio. I also made a public class in the app_code folder called 'allvars' In the main web page durning the page startup, I can refer to public shared...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.