Message110323
| Author |
brett.cannon |
| Recipients |
belopolsky, brett.cannon, christian.heimes, grahamd, gvanrossum, ncoghlan, pitrou |
| Date |
2010年07月14日.19:59:35 |
| SpamBayes Score |
1.488848e-05 |
| Marked as misclassified |
No |
| Message-id |
<AANLkTimY91VkA4vpET-1KEgmz6HG2Q17P61-bi9j5n1H@mail.gmail.com> |
| In-reply-to |
<1279136070.3128.11.camel@localhost.localdomain> |
| Content |
On Wed, Jul 14, 2010 at 12:34, Antoine Pitrou <report@bugs.python.org>wrote:
>
> Antoine Pitrou <pitrou@free.fr> added the comment:
>
> > So I say we don't worry about loaders being thread-safe. If __import__
> > handles the locking for a specific module then it will hold the lock
> > on behalf of the loader.
>
> Yes but what happens if two different modules are imported from two
> different threads, and handled by the same loader? The loader could have
> global structures which rely on serialization of imports for
> consistency.
>
That's why I said we should supply a context decorator (or function) which
will handle the lock appropriately, taking the name of the module to import
as an argument so the locking is fine-grained. |
| Files |
| File name |
Uploaded |
|
unnamed
|
brett.cannon,
2010年07月14日.19:59:35
|
|