Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msgpack.fallback.Packer.pack is not thread safe #341

Closed
yaccz opened this issue Jan 16, 2019 · 2 comments
Closed

msgpack.fallback.Packer.pack is not thread safe #341

yaccz opened this issue Jan 16, 2019 · 2 comments

Comments

@yaccz
Copy link

@yaccz yaccz commented Jan 16, 2019

msgpack.fallback.Packer.pack is not thread safe while the cython implementation seems to be by acquiring GIL. This may be a difference at least worth mentioning somewhere.

@jfolz
Copy link
Contributor

@jfolz jfolz commented Jan 16, 2019

The GIL does not make code thread-safe. It merely ensures that reference-counting is done correctly. AFAIK neither implementation is thread-safe.

@methane
Copy link
Member

@methane methane commented Jan 17, 2019

Like many classes in Python stdlib, it's is not thread safe unless it's documented as "thread safe"
explicitly. Even if Cython implementation is thread safe (I don't confirmed it yet), it's implementation detail.
You must use Cython implementation in single thread, or use mutex too.

@methane methane closed this as completed Jan 17, 2019
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

No branches or pull requests

3 participants