Title: Threading model · Issue #827 · nodegit/nodegit · GitHub
Open Graph Title: Threading model · Issue #827 · nodegit/nodegit
X Title: Threading model · Issue #827 · nodegit/nodegit
Description: 👋 I've been plumbing the depths of nodegit to understand how all the pieces fit together. I'm a bit concerned about the threading model. My understanding: We enqueue asynchronous work with Nan::AsyncQueueWorker. Nan::AsyncQueueWorker cal...
Open Graph Description: 👋 I've been plumbing the depths of nodegit to understand how all the pieces fit together. I'm a bit concerned about the threading model. My understanding: We enqueue asynchronous work with Nan::Asy...
X Description: 👋 I've been plumbing the depths of nodegit to understand how all the pieces fit together. I'm a bit concerned about the threading model. My understanding: We enqueue asynchronous work with ...
Opengraph URL: https://github.com/nodegit/nodegit/issues/827
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Threading model","articleBody":":wave: \n\nI've been plumbing the depths of nodegit to understand how all the pieces fit together. I'm a bit concerned about the threading model.\n\nMy understanding:\n1. We enqueue asynchronous work with [`Nan::AsyncQueueWorker`](https://github.com/nodegit/nodegit/blob/c4292de4adb091c1fa7daed8515c105776714310/generate/templates/partials/async_function.cc#L77).\n2. `Nan::AsyncQueueWorker` calls [`uv_queue_work`](https://github.com/nodejs/nan/blob/367e82a60fbaa52716232cc89db1cc3f685d77d9/nan.h#L1702-L1709).\n3. `uv_queue_work` [enqueues the work on a threadpool](http://docs.libuv.org/en/v1.x/threadpool.html#c.uv_queue_work).\n\nThis means:\n1. We could do work on multiple threads at once.\n2. libgit2 says its objects [shouldn't be used across multiple threads at once](https://github.com/libgit2/libgit2/blob/6aa06b65cfcce164d7ad3ef184f40acb68406078/THREADING.md#sharing-objects).\n3. We could end up accessing the same objects across multiple threads at once, most often the repository object.\n4. Potential :boom:, definite violation of libgit2's threading model.\n\nIs my understanding correct? Am I missing something?\n","author":{"url":"https://github.com/joshaber","@type":"Person","name":"joshaber"},"datePublished":"2015-12-11T15:59:54.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":15},"url":"https://github.com/827/nodegit/issues/827"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ddc069f9-cc36-f025-84aa-0f7be29ec0fc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D5B6:37DF90:1CA93BD:284B3F3:6A5FB904 |
| html-safe-nonce | f5a03182a5771fe5d6d75be270937a7ad3d15146a266470b28609c311c7d857a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENUI2OjM3REY5MDoxQ0E5M0JEOjI4NEIzRjM6NkE1RkI5MDQiLCJ2aXNpdG9yX2lkIjoiNzc1ODkzMzYxNDAwMTEwOTI1MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b4ec6268dadebb133e7e7cbe3676adc917d079e7cd5bc06e788090587910655d |
| hovercard-subject-tag | issue:121736466 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodegit/nodegit/827/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ff8769c80346f72405f9c350999e7852b101f778c43fdd6c7580810590b5ac0b/nodegit/nodegit/issues/827 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ff8769c80346f72405f9c350999e7852b101f778c43fdd6c7580810590b5ac0b/nodegit/nodegit/issues/827 |
| og:image:alt | 👋 I've been plumbing the depths of nodegit to understand how all the pieces fit together. I'm a bit concerned about the threading model. My understanding: We enqueue asynchronous work with Nan::Asy... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | joshaber |
| hostname | github.com |
| expected-hostname | github.com |
| None | e0cfc367faf9c4c774d2a903897aa214c786247c4f45ffcee48cda2b819fb0c8 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodegit/nodegit git https://github.com/nodegit/nodegit.git |
| octolytics-dimension-user_id | 657068 |
| octolytics-dimension-user_login | nodegit |
| octolytics-dimension-repository_id | 1383170 |
| octolytics-dimension-repository_nwo | nodegit/nodegit |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1383170 |
| octolytics-dimension-repository_network_root_nwo | nodegit/nodegit |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 94569c859bc88d6bf7de7e0ce3f2a11cd529a131 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width