Skip to content

An example triggering a simple deadlock in File Coordinations

Notifications You must be signed in to change notification settings

hydrixos/DeadlockExample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Deadlock Example

An example showing why you should never perform coordinated file accesses in a file presentation handler.

This example employs two file presenters. Both are handling -relinquishPresentedItemToReader: and -presentedItemDidChange. Whenever -presentedItemDidChange is called, the presenters perform a coordinated read. By that, both presenters are querying each other for relinquishing the file. This is done by enqueuing a block on the sequential -presentedItemOperationQueue of each other presenter. By that, the request will be never confirmed: the queue is already blocked by the -presentedItemDidChange notification that waits for the confirmation request of the other presenter.

About

An example triggering a simple deadlock in File Coordinations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published