syrusakbary/promise

How thread safe are promises?

dongryphon opened this issue · 6 comments

After reading through the source for some time I do not see any use of locks (like the imported and ignored from threading import RLock) to protect one thread adding a callback to a promise instance from another thread that is resolving/rejecting that promise...

So is such use of a promise invalid or does it work because of the GIL? ... or something else?

Thanks for the awesome code!

Would really appreciate even a couple words of wisdom on this...

Is this the proper place to ask questions?

I am encountering some weirdness with heavy queries seemingly randomly failing and it is only reproducible when we're making multiple concurrent requests, so we're starting to wonder if this is related. We're still investigating, so it could be totally unrelated. I am however curious if anyone else has had similar experiences.

@PepperTeasdale It sounds like your issue is related to #57

We could probably close this issue then, since the answer seems to be "no" and there are duplicate issues where people are getting errors from the threading issues. Unclear if there is any roadmap here or on graphene to fix these issues or supercede this project :(

The PR #81 has been merged. Promises should be now thread-safe in Promise 2.3.0