473,616 Members | 2,800 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 ReaderWriterLoc k 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 4848

"Qingdong Z." <an*******@disc ussions.microso ft.com> wrote in message
news:48******** *************** ***********@mic rosoft.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 ReaderWriterLoc k 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
2849
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 class is executed. It means that three derived classes are pointed to a separated copy of base class. I do not allow second and third copy of base class to be created, but it must remain only first copy of base class. It allows three derived...
5
8724
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 conceptually speaking : when do I define something as 'struct' and when as 'class' ? for example : if I want to represent a 'Time' thing, containing : - data members : hours, mins, secs
3
1422
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 page but I'm not sure how to do it in a Class. I tried using public but that didn't work. I have the following: Public Class dataClass Public Shared Function GetRep(ByVal prodNumber As Integer) As DataSet
8
11434
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 another form so to declare the sub I use visual basic code: Public Shared Function IsPortAvailable(ByVal ComPort As Integer) As Boolean
5
1154
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
8877
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 anyone have an example?
11
1578
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
1853
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 variables which are public instances of "Color". What "TypesafeConstant" does is to create a shared list, and add every declaration of itself to that list. I can then query that list with a string (e.g. "Red") to return Color.Red.
5
3804
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 variables by simply saying: x=allvars.variable1
0
8199
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8145
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8642
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8294
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8448
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7118
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6097
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4060
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.