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

Threaded View

  1. #6
    Join Date
    May 2006
    Location
    Indonesia & Japan
    Posts
    399

    Re: Update the shared variable in two parallel threads

    Quote Originally Posted by Arjay View Post
    To expand on this a bit. The example isn't thread safe because it only shows locking while adding items to the array. In order to be thread safe, locking must be performed while removing and reading items in the array.
    That's true. Locking mechanism should be applied while adding, deleting and reading the items to make an array thread-safe.
    Last edited by [email protected]; June 12th, 2010 at 09:12 AM.
    henky
    ----------------------------------
    [email protected] is not my email address anymore...
    Jangan Pernah Menyerah

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