CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Dec 2005
    Posts
    445

    InterLocked and align

    Hi all,

    Many InteLocked...... functions like InterLockedIncremet
    http://msdn.microsoft.com/en-us/libr...14(VS.85).aspx
    have the following quote in MSDN:

    "The variable pointed to by the Addend parameter must be aligned on a 32-bit boundary; otherwise, this function will behave unpredictably on multiprocessor x86 systems and any non-x86 systems. See _aligned_malloc."

    Do I need to use _alloc_maloc for evry InterLocked...... function I use??

    for example I would like to implement a spin lock using InterlockedExchange
    http://msdn.microsoft.com/en-us/libr...90(VS.85).aspx
    Do I need to align it ???

    Can someone please explain when align is required.

    Many thanks !!!
    Last edited by Salvadoravi; October 11th, 2009 at 08:48 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured