👋
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 calls uv_queue_work.
uv_queue_work enqueues the work on a threadpool.
This means:
- We could do work on multiple threads at once.
- libgit2 says its objects shouldn't be used across multiple threads at once.
- We could end up accessing the same objects across multiple threads at once, most often the repository object.
- Potential 💥, definite violation of libgit2's threading model.
Is my understanding correct? Am I missing something?
👋
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:
Nan::AsyncQueueWorker.Nan::AsyncQueueWorkercallsuv_queue_work.uv_queue_workenqueues the work on a threadpool.This means:
Is my understanding correct? Am I missing something?