|
From: | David Ayers |
Subject: | Re: GNUstep-gui make problems (linking pthreads) |
Date: | Tue, 01 Apr 2003 10:58:03 +0200 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 |
Hi, Banlu Kemiyatorn wrote:
hello, I have a question. how can I stop sorting an array while it is being sorted? I want to sort a big array in a seperated thread but sometimes the data that being sorted is obsolete and I don't want to waste cpu time with that thread anymore. is it a safe way to release the array and exit thread within the compare method?
No it wouldn't be as the code doing the sorting has no way of knowing that 'self' (a variable) has become obsolete. I think you will probably need a custom subclass of NSArray which implements an invalidatin mechanism a sorting routine which uses it.
Cheers, Dave
[Prev in Thread] | Current Thread | [Next in Thread] |