• 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: Seeking advice on NSLock usage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Seeking advice on NSLock usage


  • Subject: Re: Seeking advice on NSLock usage
  • From: Jeremy Dronfield <email@hidden>
  • Date: Mon, 13 Dec 2004 11:54:51 +0000

Thanks to all who've replied. I'm a bit clearer about lock usage, and have come to the same conclusion as Andreas:

On 13 Dec 2004, at 6:38 am, Andreas Mayer wrote:

As others have already mentioned, this is not a case for locks.

Instead you probably want to make a copy of the search criteria before starting a search. Actually I would create a kind of search class/object that holds it's own search criteria (as well as results and possibly other data). That way you could even run more that one search at a time.


After reconsidering the task last night, I implemented NSCopying in my model class. The search thread then grabs a copy when it begins searching and releases it at the end.

On further reflection, I may offer both approaches as a user option. If my search thread uses the original model instance, the practical side effect is that the user can "tune" their search criteria on the fly, while a search is in progress. In some situations I could see this being a useful option.

Thanks again to all. Regards,
Jeremy

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Seeking advice on NSLock usage
      • From: Guy English <email@hidden>
References: 
 >Seeking advice on NSLock usage (From: Jeremy Dronfield <email@hidden>)
 >Re: Seeking advice on NSLock usage (From: Andreas Mayer <email@hidden>)

  • Prev by Date: NSMovieView seems to be disabled first time?!
  • Next by Date: Re: Kill other process's warning dialog
  • Previous by thread: Re: Seeking advice on NSLock usage
  • Next by thread: Re: Seeking advice on NSLock usage
  • Index(es):
    • Date
    • Thread