Keith Emnett sem_init bug in CCTextureCache.cpp
Posts 4
Added by Keith Emnett about 1 year ago

hi - the sem_init() call is not supported on ios. it will set errno and fail to create a semaphore, meaning the sem_wait() call in the main run loop will return immediately. only named semaphores (using sem_open) are supported. i'm not sure how this affects other platforms.

http://www.lastrayofhope.com/2011/03/15/ios-semaphore-problems/
http://getoffmylawnentertainment.com/blog/2011/06/27/sem_init-function-not-implemented/

Minggo Zhang RE: sem_init bug in CCTextureCache.cpp
Posts 1641
Added by Minggo Zhang about 1 year ago

Does official Apple documents confirm it?

Keith Emnett RE: sem_init bug in CCTextureCache.cpp
Posts 4
Added by Keith Emnett about 1 year ago

If you call sem_init the return val is -1, and if you check errno after the call it is set to 78 (Function not implemented). I haven't seen any other documentation about it.

Andre Rudlaff RE: sem_init bug in CCTextureCache.cpp
Posts 48
Added by Andre Rudlaff about 1 year ago

I can confirm this as well, using the async texture loader will put the loading thread into a busy loop as the semaphore call fails instantly.
On an iPad2 I had about 120%-150% CPU usage with the loading thread active (and idle) and about 20%-30% without.
It wasn't really affecting performance as this happend on the 2nd core, but may drain the battery a lot.

Minggo Zhang RE: sem_init bug in CCTextureCache.cpp
Posts 1641
Added by Minggo Zhang about 1 year ago

Thank you.

#1214 is created for it.


(1-4/4)