Newbie question: Hopefully I worded this correctly...
Does each instance of an aspx page spawn its own thread? If so are the
threads protected? I assume each aspx page is processed in a synchronized
method and each instance has to finish processing before the next instance
is queued? If an aspx page has a class that requires lengthly processing are
all other instances of the page queued. If more than one aspx page uses the
modFoo class (simple sample before) would I be headed for trouble?
public class modFoo
{
public static Int32 lClient = 0;
public modFoo()
{
}
} 5 1141
> Does each instance of an aspx page spawn its own thread?
ASP.NET dispatches pool threads as the load of requests increase.
(Process ASPNET_WP.EXE).
Generally there's a maximum pool size so a page doesn't always spawn a
new thread.
A page is processed by a worker thread that may already have been
launched before (that is called thread pooling). I assume each aspx page is processed in a synchronized method
A page is totally processed by only one thread.
So the question is no use.
If an aspx page has a class that requires lengthly processing are all other instances of the page queued
With IIS sure and fortunately ! Again that is thread pooling that
enables parallelizing page processing.
With personal WebServer not sure.
If more than one aspx page uses the modFoo class (simple sample before) would I be headed for trouble?
public class modFoo { public static Int32 lClient = 0;
public modFoo() { } }
If each page instantiate a modFoo object, there'll be multiple threads
that will share IClient member so'll have to synchronize access to it.
If you want each thread have it's own copy of IClient, you should write
:
[ThreadStaticAtt ribute]
public static Int32 lClient = 0;
But it might not be what you want.
Exactly what I wanted..Thanks
"olrt" <ol**@ifrance.c om> wrote in message
news:11******** **************@ y43g2000cwc.goo glegroups.com.. . Does each instance of an aspx page spawn its own thread? ASP.NET dispatches pool threads as the load of requests increase. (Process ASPNET_WP.EXE). Generally there's a maximum pool size so a page doesn't always spawn a new thread. A page is processed by a worker thread that may already have been launched before (that is called thread pooling).
I assume each aspx page is processed in a synchronized method A page is totally processed by only one thread. So the question is no use.
If an aspx page has a class that requires lengthly processing are all other instances of the page queued With IIS sure and fortunately ! Again that is thread pooling that enables parallelizing page processing. With personal WebServer not sure.
If more than one aspx page uses the modFoo class (simple sample before) would I be headed for trouble?
public class modFoo { public static Int32 lClient = 0;
public modFoo() { } }
If each page instantiate a modFoo object, there'll be multiple threads that will share IClient member so'll have to synchronize access to it. If you want each thread have it's own copy of IClient, you should write :
[ThreadStaticAtt ribute] public static Int32 lClient = 0;
But it might not be what you want.
Why do you say "But it might not be what you want"? Do you have another
thought?
I also assume this would accomblish the same thing and have the same problem
(without [ThreadStatisAtt ribute]):
public class modFoo
{
private Int32 lClient = 0;
public modFoo()
{
}
public Int32 Client
{
get { return lClient; }
put { lClient = value; }
}
}
"olrt" <ol**@ifrance.c om> wrote in message
news:11******** **************@ y43g2000cwc.goo glegroups.com.. . Does each instance of an aspx page spawn its own thread? ASP.NET dispatches pool threads as the load of requests increase. (Process ASPNET_WP.EXE). Generally there's a maximum pool size so a page doesn't always spawn a new thread. A page is processed by a worker thread that may already have been launched before (that is called thread pooling).
I assume each aspx page is processed in a synchronized method A page is totally processed by only one thread. So the question is no use.
If an aspx page has a class that requires lengthly processing are all other instances of the page queued With IIS sure and fortunately ! Again that is thread pooling that enables parallelizing page processing. With personal WebServer not sure.
If more than one aspx page uses the modFoo class (simple sample before) would I be headed for trouble?
public class modFoo { public static Int32 lClient = 0;
public modFoo() { } }
If each page instantiate a modFoo object, there'll be multiple threads that will share IClient member so'll have to synchronize access to it. If you want each thread have it's own copy of IClient, you should write :
[ThreadStaticAtt ribute] public static Int32 lClient = 0;
But it might not be what you want.
If you code :
public class modFoo
{
private Int32 lClient = 0;
public modFoo()
{
}
public Int32 Client
{
get { return lClient; }
put { lClient = value; }
}
}
Each page served has it's own IClient ...
If you code :
public class modFoo
{
[ThreadStaticAtt ribute]
public static Int32 lClient = 0;
public modFoo()
{
}
}
each thread has its own IClient...
That's different...
Suppose there are two worker threads (Th1 and Th2) that serve the page.
Suppose
Th1 serves client1, client2, client3
Th2 serves client4
With [ThreadStaticAtt ribute] and static modifier :
Th1 and Th2 have their own IClient.
Without :
client1, client2, client3, client4 have their own IClient.
Thanks...very much for explanation
"olrt" <ol**@ifrance.c om> wrote in message
news:11******** *************@i 40g2000cwc.goog legroups.com... If you code : public class modFoo { private Int32 lClient = 0;
public modFoo() { }
public Int32 Client { get { return lClient; } put { lClient = value; } } }
Each page served has it's own IClient ...
If you code : public class modFoo { [ThreadStaticAtt ribute] public static Int32 lClient = 0;
public modFoo() { } }
each thread has its own IClient...
That's different...
Suppose there are two worker threads (Th1 and Th2) that serve the page. Suppose Th1 serves client1, client2, client3 Th2 serves client4
With [ThreadStaticAtt ribute] and static modifier : Th1 and Th2 have their own IClient.
Without : client1, client2, client3, client4 have their own IClient. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Brad Wood |
last post by:
As I'm studying up on threading, I'm reading about the various
mechanisms in place to serialize access to various objects. From what I
can tell, the following scenario is safe:
- Create multiple instances of a class.
- Create a thread for each instance passing it a delegate of one of the
class' methods.
- Run each thread which will:
- Modify member variables of the instance
- Read from AppSettings
|
by: Beeeeeves |
last post by:
Hi
I am looking for any articles anyone may know of on developing a finite
state machine in a gui application?
Basically what I have is a fairly complex gui which needs to go through
several (3 - 7?) states. Complex algorithms are running as their own
separate code blocks operating on class-level data structures, the
completion of the processing of one set of data takes the application from
one 'state' to another. Once the last operation...
|
by: ZorpiedoMan |
last post by:
I'm new to the world of sockets, and this question is not VB specific:
If multiple clients access the same server on the same port, and the server
is set up to do some async communication, does the server's response back to
all the clients on that port, or just to the one who sent the request?
In other words:
Client One - Request Data From Server (It takes a few seconds for the server
to get the answer)
|
by: Yong |
last post by:
I'm not getting any reply to my previous thread so I'm stating a new one.
I get a General Network Error due to my SqlCommand object not having a big
enough CommandTimeout to complete very long sql statements. My question is
this: Why does SQL generate a General Network Error instead of the Timeout
Expired Error? When I run my program multiple times, there are cases where
I'd get the Timeout Expired Error ("The timeout period elapsed...
|
by: bazzer |
last post by:
hey,
i am using visual basic.net 2003 and have an ASP.NET webform
application thats accessing a microsoft access 2003 database. i kept
getting the following error when i tried to run it:
ERROR General error
Unable to open registry key 'Temporary (volatile) Jet DSN for process
0x8fc Thread 0x934 DBC 0x437b94 Jet'. ERROR Driver's SQLSetConnectAttr failed ERROR
General error Unable to open
registry key 'Temporary (volatile) Jet DSN...
| |
by: bazzer |
last post by:
hey,
im trying to access a microsoft access database from an ASP.NET web
application in visual basic 2003.NET. i get the following error when i
try running it:
Server Error in '/CinemaBookingSystem' Application.
--------------------------------------------------------------------------------
ERROR General error
Unable to open registry key 'Temporary (volatile) Jet DSN for process
|
by: dhan |
last post by:
please give answer
|
by: Viviana Vc |
last post by:
Hi all,
I've read the WindowsVistaUACDevReqs.doc documentation and I have done
different small tests on Vista to understand the bahaviour and now I
have a few questions.
1) If I create a dummy console application that creates a file in
Program Files directory, this one will succeed and will create the file
b/c of the virtualization.
But, if I do the following call in a console window (a.exe contains just
|
by: RvGrah |
last post by:
I've been writing in C# for about 4 years now, coming from VB.net and
VB6 before that, in which I know I'm not alone. I found learning C#,
at least to the extent that I use it in developing database front-
ends, to be rather painless. The language and VS ide seemed
comfortable pretty quickly.
Some of the enhancements that have come along in the last two updates
(via VS 2005 and 2008) like Generics and now Linq and anonymous types
etc,...
|
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...
|
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,...
| |
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...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |