Re: Seeking advice on NSLock usage
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