Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Problem with parallel processing on a machine

Problem with parallel processing on a machine

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelpasp-netdatabasesql-server
7 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Llasus
    wrote on last edited by
    #1

    Hi! So I have posted this question a while back but has some additional information since I am still stuck on this problem. Here is what is supposed to happen on a server: 1) SQL Server receives request from a client 2) SQL Extended procedure launches DLL 3) Launcher DLL launches Server EXE 4) Server EXE executes Server DLL attached to it to process command Now testing this on my environment (Windows XP Service Pack 3, Core 2 DUO @2.33GHz, 2GB of RAM) and another test server (Windows Server 2003 R2 Service Pack 2, Xeon CPU @3.0GHz, 3GB of RAM) by triggering the request event (from #1) 2x simultaneously works. The request is being handled in parallel by the server. I can see that there are different instances of Server EXE (#3) being created per request. The problem is with another server environment that we have (Windows Server 2003 R2 Service Pack 2, Xeon CPU @2.5GHz, 3GB of RAM). No matter what happens, there is always 1 Server EXE being created (checked this through Process Explorer by Sysinternals) and for the next requests received, the machine just adds a new thread on the same existing Server EXE process (checked this through logs, GetCurrentProcessId and GetCurrentThreadId APIs). This is a problem, since there is only 1 Server EXE, that means that all threads are also sharing the attached Server DLL to it. Making the requests being processed sequentially instead of in parallel. I have read about this and it seems to be a multi-tenant behavior on the machine but I don't know why the machine behaves that way. Anyone has any idea/clue on this problem? I'm on a dead-end right now. Thanks! Note: As an additional information, in Launcher DLL (in #3), here is an overview of the code being executed when called: HRESULT hr = ::CoInitialize(NULL); //initialize COM Library . . ServerEXEPtr ptrServerEXE; //Server EXE object instance hr = ptrServerEXE.CreateInstance(__uuidof(ServerEXEPtr)); //Create instance of Server EXE . . ptrServerEXE->ExecuteServerCommand(param); //Will call Server EXE's method ptrServerEXE.Release(); . . ::CoUninitialize();

    E 1 Reply Last reply
    0
    • L Llasus

      Hi! So I have posted this question a while back but has some additional information since I am still stuck on this problem. Here is what is supposed to happen on a server: 1) SQL Server receives request from a client 2) SQL Extended procedure launches DLL 3) Launcher DLL launches Server EXE 4) Server EXE executes Server DLL attached to it to process command Now testing this on my environment (Windows XP Service Pack 3, Core 2 DUO @2.33GHz, 2GB of RAM) and another test server (Windows Server 2003 R2 Service Pack 2, Xeon CPU @3.0GHz, 3GB of RAM) by triggering the request event (from #1) 2x simultaneously works. The request is being handled in parallel by the server. I can see that there are different instances of Server EXE (#3) being created per request. The problem is with another server environment that we have (Windows Server 2003 R2 Service Pack 2, Xeon CPU @2.5GHz, 3GB of RAM). No matter what happens, there is always 1 Server EXE being created (checked this through Process Explorer by Sysinternals) and for the next requests received, the machine just adds a new thread on the same existing Server EXE process (checked this through logs, GetCurrentProcessId and GetCurrentThreadId APIs). This is a problem, since there is only 1 Server EXE, that means that all threads are also sharing the attached Server DLL to it. Making the requests being processed sequentially instead of in parallel. I have read about this and it seems to be a multi-tenant behavior on the machine but I don't know why the machine behaves that way. Anyone has any idea/clue on this problem? I'm on a dead-end right now. Thanks! Note: As an additional information, in Launcher DLL (in #3), here is an overview of the code being executed when called: HRESULT hr = ::CoInitialize(NULL); //initialize COM Library . . ServerEXEPtr ptrServerEXE; //Server EXE object instance hr = ptrServerEXE.CreateInstance(__uuidof(ServerEXEPtr)); //Create instance of Server EXE . . ptrServerEXE->ExecuteServerCommand(param); //Will call Server EXE's method ptrServerEXE.Release(); . . ::CoUninitialize();

      E Offline
      E Offline
      Eugen Podsypalnikov
      wrote on last edited by
      #2

      Please compare the registries of the server on the both machines :)

      virtual void BeHappy() = 0;

      L 1 Reply Last reply
      0
      • E Eugen Podsypalnikov

        Please compare the registries of the server on the both machines :)

        virtual void BeHappy() = 0;

        L Offline
        L Offline
        Llasus
        wrote on last edited by
        #3

        Hi Eugen! Thanks for your reply. I am currently comparing both the register of both machines, and the difference is really big right now (used compare tool on the saved registry settings). Might I know what specific settings should I look for or compare? Thanks again!

        E 1 Reply Last reply
        0
        • L Llasus

          Hi Eugen! Thanks for your reply. I am currently comparing both the register of both machines, and the difference is really big right now (used compare tool on the saved registry settings). Might I know what specific settings should I look for or compare? Thanks again!

          E Offline
          E Offline
          Eugen Podsypalnikov
          wrote on last edited by
          #4

          It could be something like "singleton" or ..\CLSID\{..}\SingleUse :) Can you find any usage of DECLARE_CLASSFACTORY_SINGLETON in your servers code ?

          virtual void BeHappy() = 0;

          L 1 Reply Last reply
          0
          • E Eugen Podsypalnikov

            It could be something like "singleton" or ..\CLSID\{..}\SingleUse :) Can you find any usage of DECLARE_CLASSFACTORY_SINGLETON in your servers code ?

            virtual void BeHappy() = 0;

            L Offline
            L Offline
            Llasus
            wrote on last edited by
            #5

            Hi Eugen, I have checked the registry and as with the Singleton or SingleUse, there is none. I also checked the code and there is also none of DECLARE_CLASSFACTORY_SINGLETON. The thing is, the code works on other environment except for this one machine that we have. I am checking the way the thread in the application is being created. Seems to have something to do with CoInitialize on whether the application should be as an apartment thread or multithread. Anyway I'm gonna follow that lead first.. Thank you for your help!

            E 1 Reply Last reply
            0
            • L Llasus

              Hi Eugen, I have checked the registry and as with the Singleton or SingleUse, there is none. I also checked the code and there is also none of DECLARE_CLASSFACTORY_SINGLETON. The thing is, the code works on other environment except for this one machine that we have. I am checking the way the thread in the application is being created. Seems to have something to do with CoInitialize on whether the application should be as an apartment thread or multithread. Anyway I'm gonna follow that lead first.. Thank you for your help!

              E Offline
              E Offline
              Eugen Podsypalnikov
              wrote on last edited by
              #6

              OK :) Please compare also: Start -> DCOMCNFG -> Componen Services (?) -> Computer -> Workstation -> ContextMenu -> Properties(Settings?) -> COM Security & Other pages there. Try also to unregister and then to register the server in its actual directory again, and the CoInitializeEx(..) too :)

              virtual void BeHappy() = 0;

              modified on Tuesday, March 16, 2010 10:26 AM

              L 1 Reply Last reply
              0
              • E Eugen Podsypalnikov

                OK :) Please compare also: Start -> DCOMCNFG -> Componen Services (?) -> Computer -> Workstation -> ContextMenu -> Properties(Settings?) -> COM Security & Other pages there. Try also to unregister and then to register the server in its actual directory again, and the CoInitializeEx(..) too :)

                virtual void BeHappy() = 0;

                modified on Tuesday, March 16, 2010 10:26 AM

                L Offline
                L Offline
                Llasus
                wrote on last edited by
                #7

                Eugen Podsypalnikov wrote:

                Please compare also: Start -> DCOMCNFG -> Componen Services (?) -> Computer -> Workstation -> ContextMenu -> Properties(Settings?) -> COM Security & Other pages there.

                This absolutely worked! Someone on the server made some settings on the specific application properties -> identity tab that a specific user's account will be used to launch the application instead of the launching user. Thank you very much! :)

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups