Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the Web Thread?

Due to some self induced problems, I was able to crash my iPhone app and received the following error:

Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now...

Resolving this problem isn't an issue, but the error message got me thinking...

I know what the main thread is, and I'm aware of how to switch contexts back to it. But, what is this "web thread"? I don't think I've ever heard that terminology before.

like image 387
Jason Whitehorn Avatar asked Mar 15 '11 18:03

Jason Whitehorn


1 Answers

The web thread is a single thread shared by all UIWebViews which temporarily blocks execution on the main thread while it's performing requests.

like image 51
FreeAsInBeer Avatar answered Sep 28 '22 19:09

FreeAsInBeer