Skip to content

Conversation

@tseaver
Copy link
Contributor

@tseaver tseaver commented Aug 7, 2018

/cc @BrandonY

Also note general best practice for multiprocessing use.

Closes #5685.

Also note general best practice for multiprocessing use.

Closes #5685.
@tseaver tseaver added documentation api: storage Issues related to the Cloud Storage API. labels Aug 7, 2018
@tseaver tseaver requested a review from mcdonc August 7, 2018 13:02
@tseaver tseaver requested a review from theacodes as a code owner August 7, 2018 13:02
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 7, 2018
@tseaver tseaver requested review from frankyn and removed request for theacodes August 8, 2018 12:33
share instances across threads. In multiprocessing scenarious, best
practice is to create client instances *after*
:class:`multiprocessing.Pool` or :class:`multiprocessing.Process` invokes
:func:`os.fork`.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@theacodes
Copy link
Contributor

theacodes commented Aug 14, 2018 via email

@tseaver tseaver merged commit af8547f into googleapis:master Aug 20, 2018
@tseaver tseaver deleted the 5685-storage-document_thread_mp_safety branch August 20, 2018 16:01
@kaliberto
Copy link

I ran into this same question when trying to optimize some Flask code running on GCF/GAE. Is the library written in such a way where we can make a general statement for all the APIs? Or is it really different for each API?

@tseaver
Copy link
Contributor Author

tseaver commented Jun 24, 2019

@kaliberto We have two basic groups of APIs: those which use gRPC as their basic transport, and those whic use requests/HTTP. The gRPC-based clients are threadsafe, but not fork-safe; the requests-based clients are as threadsafe as requests (i.e., no known issues).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the Cloud Storage API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document thread-safety of library

5 participants