Usage of @synchronized leads to app deadlock when firing multiple events in quick succession #63

Closed
paulshapiro opened this Issue Jun 29, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@paulshapiro

Using synchronized only, without threading, also puts most or all of your code on the main thread. This contributed to about 15% of our main queue CPU usage. Addressing this would probably make a bunch of your clients happy.

Let me know if I can provide more info here.

I'd recommend using an NSOperationQueue with a maxConcurrentOperationCount of 1. You'll have to make sure that all your enqueueing, file IO (unarchiving/archiving), and networking is synchronized and off the main thread like this.

You might want to consider using a second synchronous queue for strictly networking operations. You'll probably need to keep your enqueuing and IO on the same operation queue.

@paulshapiro

This comment has been minimized.

Show comment
Hide comment
@paulshapiro

paulshapiro Jun 29, 2013

The stack ends up looking like this when it locks up.
ss

The stack ends up looking like this when it locks up.
ss

@malectro

This comment has been minimized.

Show comment
Hide comment
@malectro

malectro Feb 3, 2015

Contributor

this is accomplished currently with the serialQueue

Contributor

malectro commented Feb 3, 2015

this is accomplished currently with the serialQueue

@malectro malectro closed this Feb 3, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment