STINNER Victor added the comment:

Lars Gustäbel added the comment:
> I agree with David that there is no need for tarfile to be thread-safe. There 
> is nothing to be gained from distributing one TarFile object among multiple 
> threads because it operates on a single resource which has to be accessed 
> sequentially anyway. So, it seems best to me if we leave it like it is and 
> let the user add locks around it as she/he sees fit.

In asyncio, it was a design choice to not be thread-safe, to allow
more optimizations and support multiple implementations of asyncio,
without this important constraint.

I modified recently the asyncio doc to warn users in each class that
asyncio objects are *not* thread safe, with an explanation how to use
correctly asyncio with threads.

https://docs.python.org/dev/library/asyncio-eventloop.html#asyncio.BaseEventLoop
"This class is not thread safe."

Such change in tarfile doc is probably enough for tarfile.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23649>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to