|
-
June 12th, 2010, 09:08 AM
#6
Re: Update the shared variable in two parallel threads
 Originally Posted by Arjay
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|