Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 20th, 2007, 10:46 AM   #1
paulchwd
Hobbyist Programmer
 
paulchwd's Avatar
 
Join Date: Mar 2005
Posts: 139
Rep Power: 4 paulchwd is on a distinguished road
Threads

I know that Apache Tomcat Servlet Container (web server) for Java takes care of threads for the programmer... by any chance is ASP.Net the same....
paulchwd is offline   Reply With Quote
Old Sep 20th, 2007, 1:08 PM   #2
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,007
Rep Power: 5 lectricpharaoh will become famous soon enough
ASP.NET is a framework, not a server. That said, the server should be managing threads in the sense that it will distribute requests across a number of threads. It's not to say that it creates a single thread per request- in fact, it most likely doesn't- but rather that it has a pool of threads, and handles requests on one of the idle ones. This technique avoids the constant creation and destruction of threads (which incurs a fair bit of overhead, especially on busy servers).
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
lectricpharaoh is offline   Reply With Quote
Old Sep 20th, 2007, 6:08 PM   #3
paulchwd
Hobbyist Programmer
 
paulchwd's Avatar
 
Join Date: Mar 2005
Posts: 139
Rep Power: 4 paulchwd is on a distinguished road
thnx for the reply...I meant to say can IIS do this....

so each request is handled in a separate thread ..one of the unused ones in the pool... and thus my code will be syncronized?
paulchwd is offline   Reply With Quote
Old Sep 21st, 2007, 2:18 AM   #4
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,007
Rep Power: 5 lectricpharaoh will become famous soon enough
Quote:
Originally Posted by paulchwd
so each request is handled in a separate thread ..one of the unused ones in the pool... and thus my code will be syncronized?
Synchronized with what? I'm not sure what you're getting at, here.

HTTP is a stateless protocol. When the user requests a resource, such as a web page, the server sends it to the client. If the resource consists of dynamically-generated content, the server generates the content, and sends it over. Multiple simultaneous requests can be handled, within the limits of the hardware; it doesn't matter if these come from the same client, or different ones. A single web page will often consist of multiple requests, the first for the page itself, and the rest for images and other items within the page. What makes HTTP stateless is that each request is a separate transaction; the browser opens a socket to the server, requests a resource, the server responds (this response is generally either the resource or an error, such as a 404), and then the socket is closed. Any appearance of a single 'session' is created by the use of cookies and/or form fields (usually hidden ones).

With ASP.NET, you're responding to user-generated events. Basically, what is happening on the client side is that when the user does certain things (such as clicking a button), client scripts (generated by ASP.NET as part of the content generation from your .aspx, .ascx, .vb, and .cs files) generate a request that is sent to the server (except for some cases such as rollovers, etc). Threading isn't really an issue here, as most of your requests should be resolved in a timely fashion. Any lengthy processing means a delay before the content is generated, which means that the server won't even start sending it to the client, who will probably say 'fuck it' and navigate away from the page (perhaps after clicking 'refresh' a few times). It's not like Windows forms programming, where you can run the UI on one thread and a lengthy background task on another, whilst updating a progress bar or something (well you sort of can, but probably not in the way you might think).
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
lectricpharaoh is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Option to increase the number of threads listed peace_of_mind Community Announcements and Feedback 6 Jul 21st, 2006 6:41 AM
Evaporating threads DaWei Coder's Corner Lounge 20 Nov 12th, 2005 9:26 AM
Unanswered Threads java_roshan Community Announcements and Feedback 1 Aug 7th, 2005 9:43 AM
Multiple server clients using sockets + Threads captainK Java 3 Mar 4th, 2005 10:10 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:32 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC