This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients belopolsky, brett.cannon, christian.heimes, grahamd, gvanrossum, ncoghlan, neologix, pitrou, vstinner
Date 2011-12-30.11:42:30
SpamBayes Score 4.4219023e-06
Marked as misclassified No
Message-id <1325245286.3330.15.camel@localhost.localdomain>
In-reply-to <>
> If, on the other hand, we really want to reduce the number of cases
> where a deadlock would occur by increasing the locking granularity,
> then it's the way to go.

Yes, that's the point. Today you have to be careful when mixing imports
and threads. The problems is that imports can be implicit, inside a
library call for example (and putting imports inside functions is a way
of avoiding circular imports, or can also allow to reduce startup time).
Some C functions try to circumvent the problem by calling
PyImport_ModuleNoBlock, which is ugly and fragile in its own way (it
will fail if the import lock is taken, even if there wouldn't be a
deadlock: a very primitive kind of deadlock avoidance indeed).

> Also, a quick search returned those links:
> So it seems that sem_init() can fail when the max number of semaphores
> is reached.

As they say, "Kritirii choice of the number 30 in the XXI century is
unclear." :-)

File objects also have a per-object lock, so I guess opening 30 files
under FreeBSD would fail. Perhaps we need to fallback on the other lock
implementation on certain platforms?

(our FreeBSD 8.2 buildbot looks pretty much stable, was the number of
semaphores tweaked on it?)
Date User Action Args
2011-12-30 11:42:31pitrousetrecipients: + pitrou, gvanrossum, brett.cannon, ncoghlan, belopolsky, vstinner, christian.heimes, grahamd, neologix
2011-12-30 11:42:31pitroulinkissue9260 messages
2011-12-30 11:42:30pitroucreate