Thursday, September 10, 2009

GCD and Blocking Kernel Call

Tim Wood:

On the whole, this seems great, but in specific cases it may bite developers that don’t expect it. In my real code, I’m processing a couple thousand compressed files. At the top of each block, I was opening one compressed file and reading its contents. These I/O calls are blocking and would let GCD spin up more operations. Having 1000 threads all fire up and allocate all the memory in the system wedged my machine for a while and confused me since I thought GCD was supposed to handle this.

I thought so, too. GCD is in a better position than the application to know and manage global I/O.

Comments RSS · Twitter

Leave a Comment