multithread in an application WEB? ??

  • Thread starter Thread starter AAAAA
  • Start date Start date
A

AAAAA

Hi friends,
So that you would use multithread in an application WEB?

Thanks

Cesar
 
All web applications are multithreaded by default (each aspx request
is handled by any of a large number of worker threads).

Sam
 
All web applications are multithreaded by default (each aspx request
is handled by any of a large number of worker threads).

But is it correct to say that my aspx/code-behind class is instantiated
anew on each request to it?

Or is it at least guaranteed that the instance of my class won't receive a
second request while it is processing the first request?

Or can I risk that there is only the one instance of my class, and it can
receive a second request while it is still processing the first request?


/Peter
 
* Peter K wrote, On 15-6-2007 10:24:
But is it correct to say that my aspx/code-behind class is instantiated
anew on each request to it?

Or is it at least guaranteed that the instance of my class won't receive a
second request while it is processing the first request?

Or can I risk that there is only the one instance of my class, and it can
receive a second request while it is still processing the first request?


/Peter

A new instance is used for each request. There can be more than one
request to the same page being handled at the same time, so there can be
multiple instances (so avoid the use of static properties & fields).

Jesse
 
Jesse Houwing said:
A new instance is used for each request. There can be more than one
request to the same page being handled at the same time, so there can be
multiple instances (so avoid the use of static properties & fields).

Unless you use the appropriate locking on your critical regions.
Static properties & fields can be very usefull.

Kind Regards,
Allan Ebdrup
 
* Allan Ebdrup wrote, On 15-6-2007 13:53:
Unless you use the appropriate locking on your critical regions.
Static properties & fields can be very usefull.

Agreed. But only if you know what you're doing.
 
Hi,

Peter K said:
But is it correct to say that my aspx/code-behind class is instantiated
anew on each request to it?

Yes, that's correct each time a new instance is created and the controls's
values populated based on the state being returned by the page.
Or is it at least guaranteed that the instance of my class won't receive a
second request while it is processing the first request?

Each request will have its own individual instance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top