• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Accessing array in thread safe way
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing array in thread safe way


  • Subject: Re: Accessing array in thread safe way
  • From: CoGe - Tamas Nagy <email@hidden>
  • Date: Thu, 08 Mar 2012 20:29:44 +0100

On Mar 8, 2012, at 6:52 PM, Jan E. Schotsman wrote:

>
> On Mar 8, 2012, at 3:22 PM, CoGe - Tamas Nagy wrote:
>
>> Maybe this will helps you, here is my thread-safe subclass of NSMutableArray: http://code.google.com/p/cogeopensource/source/browse/trunk/CoGeOpenSource/CoGeThreadSafeMutableArray.m
>
> Thanks for the code.
> I have two questions:
>
> 1. If you believe that OSSpinLock is faster than NSLock why don't you use it for your thread-safe mutable array class too?

I mostly using the NSMutableDictionary subclass, and just forgot to update the NSMutableArray class. Thats the only reason,


>
> 2. Once you start using an enumerator for the array you probably need  a explicit mutex after all. Isn't it simpler to just use  @synchronized(array) wherever the array is accessed?

@syncronized(array) is not really fast.

>
> Jan E.
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden

Tamas Nagy
-----------------
CoGe VJ Software
http://cogevj.hu
email@hidden




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >Accessing array in thread safe way (From: "Jan E. Schotsman" <email@hidden>)
 >Re: Accessing array in thread safe way (From: Charles Srstka <email@hidden>)
 >Re: Accessing array in thread safe way (From: "Jan E. Schotsman" <email@hidden>)
 >Re: Accessing array in thread safe way (From: CoGe - Tamas Nagy <email@hidden>)
 >Re: Accessing array in thread safe way (From: "Jan E. Schotsman" <email@hidden>)

  • Prev by Date: Re: Accessing array in thread safe way
  • Next by Date: Re: Accessing array in thread safe way
  • Previous by thread: Re: Accessing array in thread safe way
  • Next by thread: Re: Accessing array in thread safe way
  • Index(es):
    • Date
    • Thread