none
Force a specific processor affinity on an unmanaged DLL call from VB.NET RRS feed

  • Question

  • I am calling a function from a VB.NET webserver to a custom written unmanaged DLL.
    If we call this DLL via a webservice on a multi-core server we run into problems and it always crashes.
    If I reboot the server and make it only use a single-core, it always runs fine and never crashes.
    I know the DLL call is responsible for the crash as I have outputted debugging code just before and after the DLL call.
    I can force the processor affinity of the .NET code to 1 core but this doesn't apply to the unmanaged DLL.
    How can I force the unmanaged DLL to only run on a single core as I am sure this will solve the problem?
    I have read about maybe being able to do this with the JobObject class but I can't get this to work.

    • Edited by Pascal KH Monday, January 23, 2012 10:57 AM
    Monday, January 23, 2012 10:57 AM

All replies

  • Thursday, January 26, 2012 1:20 AM
  • In this case, I think we should do a live debugging or capture a dump for further investigation.

    You can use ADPlus to capture a dump file. ADPlus is shipped with Debugging Tools For Windows which available at here, you can try this command to capture a dump file:

    adplus -crash -o d:\dumps -pn MyApplication

     

    You said the dll can be called successfully, so we need to know what causes it crashes.

    Thanks. Have a nice day.


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Thursday, January 26, 2012 5:19 AM