----- Original Message -----
> ...
> - about the pmContext global locking - I think this can all be
> safely removed now that the pmapi C routines all have locking?
> Pretty sure there's at least one deadlock there too (pmprintf()
> wrapper holds that lock for an awfully long time - if any other
> python calls come in before the flush = deadlock?). My vote is
> for complete removal, and reliance on the C code locking (seems
> silly to double up anyway - I suspect the python locks predate
> the libpcp locking, so nowadays its not needed).
Just noticed also that some error paths in pmRecordSetup() and
pmRecordAddHost() fail to release the lock. But, not a problem
if the lock is removed. :) These routines didn't actually need
a lock in the first place, afaict, as they don't use contexts.
Another simplification - we should also remove _lastUsedContext,
and simply call libpcp.pmUseContext whenever a call is going to
be made that will use a host/archive context (using self.ctx).
Switching contexts is lightweight, its not worth all that extra
python code to avoid calling pmUseContext.
cheers.
--
Nathan
|