Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Clean mutexes as part of garbage collection cycle instead of uv_async#880

Merged
johnhaley81 merged 1 commit intonodegit:masternodegit/nodegit:masterfrom
srajko:thread-safety-gcsrajko/nodegit:thread-safety-gcCopy head branch name to clipboard
Jan 28, 2016
Merged

Clean mutexes as part of garbage collection cycle instead of uv_async#880
johnhaley81 merged 1 commit intonodegit:masternodegit/nodegit:masterfrom
srajko:thread-safety-gcsrajko/nodegit:thread-safety-gcCopy head branch name to clipboard

Conversation

@srajko
Copy link
Collaborator

@srajko srajko commented Jan 27, 2016

Leaving the uv_async handle open was causing the node process to hang on exit. Cleaning up mutexes on garbage collection achieves the same goal (mutexes will get cleaned up at some point, when they are no longer needed), and avoids the issue.

Using the GC is probably better performance-wise with thread safety enabled (mutex cleanup should be less frequent). With thread-safety disabled, the mutex cleanup gets skipped (though for simplicity, the GC callback is configured throughout - I imagine this has minimal performance impact).

Fixes #866.

@srajko srajko changed the title Clean mutexes as part of garbage collection cycle instead of uv_async [WIP] Clean mutexes as part of garbage collection cycle instead of uv_async Jan 27, 2016
@srajko srajko changed the title [WIP] Clean mutexes as part of garbage collection cycle instead of uv_async Clean mutexes as part of garbage collection cycle instead of uv_async Jan 27, 2016
@tbranyen
Copy link
Member

😍

johnhaley81 added a commit that referenced this pull request Jan 28, 2016
Clean mutexes as part of garbage collection cycle instead of uv_async
@johnhaley81 johnhaley81 merged commit b75ea08 into nodegit:master Jan 28, 2016
@srajko srajko deleted the thread-safety-gc branch March 24, 2016 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.