Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


Rephrasing: IIS thread pool and COM DLL's

OSR_Community_UserOSR_Community_User Member Posts: 110,217
Since my last two attempts don't seem to be generating any responses, I'll
simplify the question <grin>:

When the IIS thread pool is accessing a COM DLL, what must I do to insure
that each IIS thread has a one-to-one relationship with instances of the COM
objects?

Example: Presume five users simultaneously visit the IIS-powered website,
all of whom do something which accesses the COM DLL. Five threads from the
IIS thread pool fire up, each taking responsibility for one of the users.
Five COM objects should be instantiated, one associated with each thread. As
the threads write property values into the objects, we must make certain
that the threads access only only one object, and that object must be the
same object every time so that the threads don't overwrite each other's
values. Since the threads outlive the user's request and response, I presume
all five objects will continue to exist too... and thus we must maintian the
1:1 relationship between instantiated objects and the IIS worker threads
basically forever.

I can't find anything in MSDN which directly addresses this topic.
Assistance is appreciated!

Thanks!

Comments

  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    > Example: Presume five users simultaneously visit the IIS-powered website,
    > all of whom do something which accesses the COM DLL. Five threads from

    If you want to maintain 1:1 relationship between IIS's _clients_ and your
    instances - using ASP's Session object and Session_OnStart event is the very
    best idea.
    Otherwise, you will need to do all this cookies stuff by hand.

    Max
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    At 04:25 AM 06/23/2000 +0400, you wrote:
    >> Example: Presume five users simultaneously visit the IIS-powered website,
    >> all of whom do something which accesses the COM DLL. Five threads from
    >
    >If you want to maintain 1:1 relationship between IIS's _clients_ and your
    >instances - using ASP's Session object and Session_OnStart event is the very
    >best idea.
    >Otherwise, you will need to do all this cookies stuff by hand.

    No, I specifically do NOT want to link objects to sessions, nor does this
    involve cookies. I need to relate objects to _threads_. Each of IIS's
    threads needs the ability to create and use an object, but we must prevent
    threads from using any but their own single object. This has nothing to do
    with users, but only with the thread pool that IIS maintains.
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    > No, I specifically do NOT want to link objects to sessions, nor does this
    > involve cookies. I need to relate objects to _threads_. Each of IIS's
    > threads needs the ability to create and use an object, but we must prevent
    > threads from using any but their own single object. This has nothing to do

    Then "Apartment" threading model is exactly what you need.

    Max
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Kernel Debugging 13-17 May 2024 Live, Online
Developing Minifilters 1-5 Apr 2024 Live, Online
Internals & Software Drivers 11-15 Mar 2024 Live, Online
Writing WDF Drivers 20-24 May 2024 Live, Online