![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Mar 2005
Posts: 139
Rep Power: 4
![]() |
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....
|
|
|
|
|
|
#2 |
|
Caffeinated Neural Net
![]() Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,007
Rep Power: 5
![]() |
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 |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
Join Date: Mar 2005
Posts: 139
Rep Power: 4
![]() |
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? |
|
|
|
|
|
#4 | |
|
Caffeinated Neural Net
![]() Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,007
Rep Power: 5
![]() |
Quote:
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 |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |