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. MFC-App and Hyper-Threading

MFC-App and Hyper-Threading

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++algorithmsjsonlearning
3 Posts 3 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.
  • T Offline
    T Offline
    tabor25
    wrote on last edited by
    #1

    Hello, maybe this can be of interest for someone: my multi-threading mfc-app crashed sometimes not reproducable on systems with hyper-threading active. So it would be very nice if i could tell my app to use only one cpu even if hyper-threading is active. After searching msdn and the internet for a method to do this, i found this api-function: SetProcessAffinityMask(GetCurrentProcess(), 1); The first parameter is the handle to the current process (my app) and the second parameter is a 32-bit value (mask) where every bit represents a cpu. Calling this function solved the problem of my hardly to reproduce exceptions. Of course it does not fix the problem at the root because my app isn't HT-compatible at least, but now i have more time to learn about the difference between using HT and not using HT. Maybe someone knows a good starting-point for this. Best regards, Tabor25

    M V 2 Replies Last reply
    0
    • T tabor25

      Hello, maybe this can be of interest for someone: my multi-threading mfc-app crashed sometimes not reproducable on systems with hyper-threading active. So it would be very nice if i could tell my app to use only one cpu even if hyper-threading is active. After searching msdn and the internet for a method to do this, i found this api-function: SetProcessAffinityMask(GetCurrentProcess(), 1); The first parameter is the handle to the current process (my app) and the second parameter is a 32-bit value (mask) where every bit represents a cpu. Calling this function solved the problem of my hardly to reproduce exceptions. Of course it does not fix the problem at the root because my app isn't HT-compatible at least, but now i have more time to learn about the difference between using HT and not using HT. Maybe someone knows a good starting-point for this. Best regards, Tabor25

      M Offline
      M Offline
      Marc Soleda
      wrote on last edited by
      #2

      Nice to know, thx ... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.

      1 Reply Last reply
      0
      • T tabor25

        Hello, maybe this can be of interest for someone: my multi-threading mfc-app crashed sometimes not reproducable on systems with hyper-threading active. So it would be very nice if i could tell my app to use only one cpu even if hyper-threading is active. After searching msdn and the internet for a method to do this, i found this api-function: SetProcessAffinityMask(GetCurrentProcess(), 1); The first parameter is the handle to the current process (my app) and the second parameter is a 32-bit value (mask) where every bit represents a cpu. Calling this function solved the problem of my hardly to reproduce exceptions. Of course it does not fix the problem at the root because my app isn't HT-compatible at least, but now i have more time to learn about the difference between using HT and not using HT. Maybe someone knows a good starting-point for this. Best regards, Tabor25

        V Offline
        V Offline
        vikas amin
        wrote on last edited by
        #3

        Good Thank you if any one has idea how to do a VPN connection through a vc++ ?? Some special API's for it are availabel for VPN connection? Vikas Amin Embin Technology Bombay vikas.amin@embin.com

        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