CPU rises with attributesOfItemAtPath: error:

I am using the [NSFileManager attributesOfItemAtPath:error:] function to get the attributes of a file. But sometimes my application processor reaches 100%. I use this function for files with a size of 100 thousand (About).
An example of my application:

  2128 -[NSFileManager attributesOfItemAtPath:error:] 2128 +[NSFileAttributes _attributesAtPath:partialReturn:filterResourceFork:error:] 2123 _attributesAtPath 2072 listxattr 29 realloc 18 realloc 11 szone_size 22 _attributesAtPath 5 _sysenter_trap 

Can anyone help me out?

+1
objective-c cocoa nsfilemanager macos sysenter
May 14 '12 at 9:12
source share
2 answers

I am using stat .

 #import <sys/stat.h> struct stat stat1; if( stat([inFilePath fileSystemRepresentation], &stat1) ) // something is wrong long long size = stat1.st_size; printf("Size: %lld\n", stat1.st_size); 
+3
Aug 03 2018-12-12T00:
source share
  • SYSENTER is the accompanying instruction for SYSEXIT . A trap is a subset of the full thread context. Thus, the trap frame stores information about the current context of the stream so that it can restore it using the SYSEXIT command.

Link to Sysenter_traps .

It seems that you are overloading your main thread. That's why cpu is 100%

+1
May 14 '12 at 9:39 a.m.
source share



All Articles