Looking for workaround for 32 cpu limitation using GetProcessAffinityMask in 32 bit process











up vote
-1
down vote

favorite












I've just realized that GetProcessAffinityMask can't return values larger than 4'294'967'295 (1111 1111 1111 1111 1111 1111 1111 1111) in 32 bit applications, even on a 64 bit system.



This means that I'm unable to correctly detect system affinity mask on machines with more than 32 logical processors. Is there any hack to get other half of the affinity mask in this case?










share|improve this question
























  • Even in a 64 bit process (that being the obvious way to try to solve the problem) you come unstuck when there are more than 64 processors. What do you propose to do then?
    – David Heffernan
    Nov 19 at 16:32










  • @DavidHeffernan, wouldn't SetThreadGroupAffinity() solve that problem? ;)
    – whosrdaddy
    Nov 19 at 16:36












  • @DavidHeffernan Max cpu group size in windows is 64 so if you have more logical cpus then OS will create "fake" numa nodes.
    – Atak_Snajpera
    Nov 19 at 16:37












  • This might by interesting.
    – Jabberwocky
    Nov 19 at 16:39










  • Yes, I know that, I was wondering whether you were aware of the issue. If you have a multi group process then GetProcessAffinityMask returns zero for both masks. I suppose my real point is that GetProcessAffinityMask becomes much less useful on such machines because of these issues. So perhaps even if you can succeed in getting the info (e.g. via a 64 bit process) then it may not do you any real good. When I need this information, I call GetLogicalProcessorInformationEx.
    – David Heffernan
    Nov 19 at 16:41

















up vote
-1
down vote

favorite












I've just realized that GetProcessAffinityMask can't return values larger than 4'294'967'295 (1111 1111 1111 1111 1111 1111 1111 1111) in 32 bit applications, even on a 64 bit system.



This means that I'm unable to correctly detect system affinity mask on machines with more than 32 logical processors. Is there any hack to get other half of the affinity mask in this case?










share|improve this question
























  • Even in a 64 bit process (that being the obvious way to try to solve the problem) you come unstuck when there are more than 64 processors. What do you propose to do then?
    – David Heffernan
    Nov 19 at 16:32










  • @DavidHeffernan, wouldn't SetThreadGroupAffinity() solve that problem? ;)
    – whosrdaddy
    Nov 19 at 16:36












  • @DavidHeffernan Max cpu group size in windows is 64 so if you have more logical cpus then OS will create "fake" numa nodes.
    – Atak_Snajpera
    Nov 19 at 16:37












  • This might by interesting.
    – Jabberwocky
    Nov 19 at 16:39










  • Yes, I know that, I was wondering whether you were aware of the issue. If you have a multi group process then GetProcessAffinityMask returns zero for both masks. I suppose my real point is that GetProcessAffinityMask becomes much less useful on such machines because of these issues. So perhaps even if you can succeed in getting the info (e.g. via a 64 bit process) then it may not do you any real good. When I need this information, I call GetLogicalProcessorInformationEx.
    – David Heffernan
    Nov 19 at 16:41















up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I've just realized that GetProcessAffinityMask can't return values larger than 4'294'967'295 (1111 1111 1111 1111 1111 1111 1111 1111) in 32 bit applications, even on a 64 bit system.



This means that I'm unable to correctly detect system affinity mask on machines with more than 32 logical processors. Is there any hack to get other half of the affinity mask in this case?










share|improve this question















I've just realized that GetProcessAffinityMask can't return values larger than 4'294'967'295 (1111 1111 1111 1111 1111 1111 1111 1111) in 32 bit applications, even on a 64 bit system.



This means that I'm unable to correctly detect system affinity mask on machines with more than 32 logical processors. Is there any hack to get other half of the affinity mask in this case?







winapi






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 19 at 16:30









David Heffernan

513k338111204




513k338111204










asked Nov 19 at 16:23









Atak_Snajpera

256211




256211












  • Even in a 64 bit process (that being the obvious way to try to solve the problem) you come unstuck when there are more than 64 processors. What do you propose to do then?
    – David Heffernan
    Nov 19 at 16:32










  • @DavidHeffernan, wouldn't SetThreadGroupAffinity() solve that problem? ;)
    – whosrdaddy
    Nov 19 at 16:36












  • @DavidHeffernan Max cpu group size in windows is 64 so if you have more logical cpus then OS will create "fake" numa nodes.
    – Atak_Snajpera
    Nov 19 at 16:37












  • This might by interesting.
    – Jabberwocky
    Nov 19 at 16:39










  • Yes, I know that, I was wondering whether you were aware of the issue. If you have a multi group process then GetProcessAffinityMask returns zero for both masks. I suppose my real point is that GetProcessAffinityMask becomes much less useful on such machines because of these issues. So perhaps even if you can succeed in getting the info (e.g. via a 64 bit process) then it may not do you any real good. When I need this information, I call GetLogicalProcessorInformationEx.
    – David Heffernan
    Nov 19 at 16:41




















  • Even in a 64 bit process (that being the obvious way to try to solve the problem) you come unstuck when there are more than 64 processors. What do you propose to do then?
    – David Heffernan
    Nov 19 at 16:32










  • @DavidHeffernan, wouldn't SetThreadGroupAffinity() solve that problem? ;)
    – whosrdaddy
    Nov 19 at 16:36












  • @DavidHeffernan Max cpu group size in windows is 64 so if you have more logical cpus then OS will create "fake" numa nodes.
    – Atak_Snajpera
    Nov 19 at 16:37












  • This might by interesting.
    – Jabberwocky
    Nov 19 at 16:39










  • Yes, I know that, I was wondering whether you were aware of the issue. If you have a multi group process then GetProcessAffinityMask returns zero for both masks. I suppose my real point is that GetProcessAffinityMask becomes much less useful on such machines because of these issues. So perhaps even if you can succeed in getting the info (e.g. via a 64 bit process) then it may not do you any real good. When I need this information, I call GetLogicalProcessorInformationEx.
    – David Heffernan
    Nov 19 at 16:41


















Even in a 64 bit process (that being the obvious way to try to solve the problem) you come unstuck when there are more than 64 processors. What do you propose to do then?
– David Heffernan
Nov 19 at 16:32




Even in a 64 bit process (that being the obvious way to try to solve the problem) you come unstuck when there are more than 64 processors. What do you propose to do then?
– David Heffernan
Nov 19 at 16:32












@DavidHeffernan, wouldn't SetThreadGroupAffinity() solve that problem? ;)
– whosrdaddy
Nov 19 at 16:36






@DavidHeffernan, wouldn't SetThreadGroupAffinity() solve that problem? ;)
– whosrdaddy
Nov 19 at 16:36














@DavidHeffernan Max cpu group size in windows is 64 so if you have more logical cpus then OS will create "fake" numa nodes.
– Atak_Snajpera
Nov 19 at 16:37






@DavidHeffernan Max cpu group size in windows is 64 so if you have more logical cpus then OS will create "fake" numa nodes.
– Atak_Snajpera
Nov 19 at 16:37














This might by interesting.
– Jabberwocky
Nov 19 at 16:39




This might by interesting.
– Jabberwocky
Nov 19 at 16:39












Yes, I know that, I was wondering whether you were aware of the issue. If you have a multi group process then GetProcessAffinityMask returns zero for both masks. I suppose my real point is that GetProcessAffinityMask becomes much less useful on such machines because of these issues. So perhaps even if you can succeed in getting the info (e.g. via a 64 bit process) then it may not do you any real good. When I need this information, I call GetLogicalProcessorInformationEx.
– David Heffernan
Nov 19 at 16:41






Yes, I know that, I was wondering whether you were aware of the issue. If you have a multi group process then GetProcessAffinityMask returns zero for both masks. I suppose my real point is that GetProcessAffinityMask becomes much less useful on such machines because of these issues. So perhaps even if you can succeed in getting the info (e.g. via a 64 bit process) then it may not do you any real good. When I need this information, I call GetLogicalProcessorInformationEx.
– David Heffernan
Nov 19 at 16:41














1 Answer
1






active

oldest

votes

















up vote
1
down vote













The supported way to do this is to use a 64 bit process.



If you are unable to covert your application to 64 bit then create and call a small helper process to do the work, and pass the information back to your 32 bit application.






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53378828%2flooking-for-workaround-for-32-cpu-limitation-using-getprocessaffinitymask-in-32%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote













    The supported way to do this is to use a 64 bit process.



    If you are unable to covert your application to 64 bit then create and call a small helper process to do the work, and pass the information back to your 32 bit application.






    share|improve this answer

























      up vote
      1
      down vote













      The supported way to do this is to use a 64 bit process.



      If you are unable to covert your application to 64 bit then create and call a small helper process to do the work, and pass the information back to your 32 bit application.






      share|improve this answer























        up vote
        1
        down vote










        up vote
        1
        down vote









        The supported way to do this is to use a 64 bit process.



        If you are unable to covert your application to 64 bit then create and call a small helper process to do the work, and pass the information back to your 32 bit application.






        share|improve this answer












        The supported way to do this is to use a 64 bit process.



        If you are unable to covert your application to 64 bit then create and call a small helper process to do the work, and pass the information back to your 32 bit application.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 19 at 17:01









        David Heffernan

        513k338111204




        513k338111204






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53378828%2flooking-for-workaround-for-32-cpu-limitation-using-getprocessaffinitymask-in-32%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

            Alcedinidae

            Origin of the phrase “under your belt”?