Search

The ISAPI Execution Environment

1 views

This document bases on information and testing done with IIS 1.0. We have not re-tried it with later versions. However, we feel very comfortable with the information contained herein and think that it still is correct. There is just one exception: if you create an application in MMC under IIS 4.0, your ISAPI extension is run in a separate process space (as far as we know under MTS control). In this case, you obviously do not run in the process space of IIS (that's why it is called process isolation). As far as your extension is concerned, that should make no big difference. When we first started developing isapi apps, things were first very clear to us. However, as soon as we hit the field of "real" IIS application with multiple concurrent requests and multiple extensions being loaded, things became quite more complicated. All of a sudden, some things looked really confusing. We found that the key to order this things at get a productive application out of our coding is understanding what IIS really does and how an extension is executed. This is what we call the ISAPI Execution Environmen and this is what this document is all about. We hope it will save you some valuable time when first starting isapi development. In order to allow easy offline storage and printout, we have created just this single, relativly large document. People with slow links and/or not-so-current browsers, please forgive us. We think it is the best compromise available. If you find anything to add, correct or otherwise change in this document, please do not hesitate to

  • When w3svc starts, it does its initialization work. During its initialization, it checks the registry for installed isapi filters and initializes them (note: the life of an isapi filter won't be discussed any further). W3svc also loads and initializes some other WOSA services, like Windows sockets and ODBC (for logging purposes).
  • During its initialization phase IIS creates a number of threads that later on will be used to serve clients. If you look with the process viewer application at an just started-up IIS, there are usually between 12 and 14 threads in its process space, a lot of them without any processing so far. We think these threads build a pool of "worker threads". However, we found no documentation on that so far.
  • Being started up, IIS listens for HTTP-requests. As soon as one comes in, IIS assigns a worker thread (usually the same that's the shortest one finished) to the request and carries on processing (we think - but have not verified - that the number of worker threads is extensible as more concurrent requests come in).
  • The worker thread then analyses the type of request. It uses the configuration settings supplied by Internet Service Manager to decide on what to do next. Choices are "web file services" (just deliver the need file more or less unprocessed) or call an extension. In the later case there can be numerous extensions to call - basically they are all the same: call an isapi extension. This is even true with IDC, in which case the IDCODBC.DLL isapi extension is called.
  • Now we get into business. Let's think the worker thread has requested that our app is to call.
  • Share this article

    Comments (0)

    Please sign in to leave a comment.

    No comments yet. Be the first to comment!