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. Compare And Set 64 bit

Compare And Set 64 bit

Scheduled Pinned Locked Moved C / C++ / MFC
questionalgorithms
2 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.
  • W Offline
    W Offline
    Waldermort
    wrote on last edited by
    #1

    On most 32 bit systems bit 1 and 2 are not used in an address. This allows the CAS algorithm to test an address and also test a flag (very useful for non blocking linked lists). However on a 64 bit system those 2 bit are in use. After doing some googling I have found that AMD64 and IA64 use 48 bits. AMD plans to extend that 52 bits. So my question is, Am I safe to use bit 1 of a 64 bit address, if so will it be portable?

    Waldermort

    K 1 Reply Last reply
    0
    • W Waldermort

      On most 32 bit systems bit 1 and 2 are not used in an address. This allows the CAS algorithm to test an address and also test a flag (very useful for non blocking linked lists). However on a 64 bit system those 2 bit are in use. After doing some googling I have found that AMD64 and IA64 use 48 bits. AMD plans to extend that 52 bits. So my question is, Am I safe to use bit 1 of a 64 bit address, if so will it be portable?

      Waldermort

      K Offline
      K Offline
      Klaus Werner Konrad
      wrote on last edited by
      #2

      What exactly do you want to ask ? Is it processor architecture ? Is it C, or C++, or C# ? Is it Win32 / Win64 ? Is it about pointers ? If you (in C/C++/C#) have a BYTE array, then ALL lower bits of an address WILL be used; ohterwise you wouldn't be able to do a bulk read or write from a binary file. Of course, if you do so, you will earn a lot of additional CPU cycles due to misalignment of addresses to WORD / DWORD boundaries, but as cores are so fast now, it doesn't really matters

      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