ISAPI extesion loads cli/clr which forces threads affinity to the 1st processor only [Answered]RSS

1 reply

Last post Apr 01, 2011 05:50 AM by oritalul

  • ISAPI extesion loads cli/clr which forces threads affinity to the 1st processor only

    Mar 30, 2011 04:15 PM|oritalul|LINK

     Hi,

     We have an IIS running on 4 CPUs machine (4 cores).

    We wrote code in the IIS extension which creates several threads which are spread evenly on all the 4 CPUs.

    These threads executes (among other things) code of a cli/clr dll after this code is executed all the threads are set to run on one core (the 1st one).

    Do you know what might be the cause to this strange phenomenon? And this can be avoid?

     

    Thanks,

    Orit

    c# iis c++ .NET ISAPI Extension

  • Re: ISAPI extesion loads cli/clr which forces threads affinity to the 1st processor only

    Apr 01, 2011 05:50 AM|oritalul|LINK

     

    Hi,


    I found the problem! There was a bug in the code!

    There was a CStopwatch class I used to measure the application performence.

    This class's c'tor set the thread affinity to the 1st processor + performed sleep, which caused all the application threads to run on one CPU and sleep most of the time...



    Best regards,

    Orit