From: Adam M. <ama...@ma...> - 2008-07-14 18:58:10
|
On 2008-07-14 11:21:21 -0700, Christiaan Hofman <cmh...@gm...> said: > > On 14 Jul 2008, at 7:49 PM, Adam Maxwell wrote: > >> On 2008-07-14 10:10:15 -0700, Christiaan Hofman <cmh...@gm...> >> said: >>> The main reason it's set in the main thread is that a running (long) >>> task may decide to stop executing, e.g. in a long while-loop. If >>> shouldKeepRunning is set to 0 on the server thread it won't happen >>> till the current calculation has finished. >> >> It won't happen until the end of the calculation loop anyway unless >> the >> calculation loop runs the runloop and checks that flag, though, right? >> > > It may. The shouldKeepRunning flag is checked in various places, in > particular in while-loops, so the long loops are terminated when it is > reset. Good point, although I don't see -[BDSKAsynchronousDOServer shouldKeepRunning] used in any loops at this time. Probably worth a comment in the code. > That's very important. For example the file content search > index can take an hour, so it is important that it knows when it's no > longer needed. Did you change file content search to use BDSKAsynchronousDOServer instead of a queue? -- adam |