On 19 Aug 2007, at 1:50 AM, Adam R. Maxwell wrote: > I was looking at some of the refactoring in Skim, and noticed that the > file functions are supposed to be thread safe. Isn't there a > potential race condition in SKTemporaryDirectoryCreating, if multiple > threads are creating baseTmpDir or incrementing a counter to find a > unique name? In BibDesk's NSFileManager method we use > @synchronized(self) to guard against that, but the function might need > a mutex created in an __attribute__((constructor)) (or use CFUUID to > make a unique name). > > -- > adam
@synchronize actually is completely useless here, as this only works when it's used always, which is certainly not true here. Note that NSFileManager itself is not thread safe. The problem with CFUUID (or -[NSProcessInfo globallyUniqueString] for that matter) is that it leads to long file names. We are limited by the fact that mount points for a disk image have a maximum length of 90. Christiaan ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ skim-app-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/skim-app-develop
