This repository was archived by the owner on Feb 20, 2024. It is now read-only.

Description
It appears that it's incredibly difficult to use the asynchronous callback mechanism due to lock ordering issues:
- The callback thread pool holds various Xrootd locks when it invokes python, which needs the python GIL.
- Python-owned threads have the python GIL and needs various Xrootd locks when invoking operations in the Xrootd module.
Hence, it's quite straightforward to deadlock.
In order to actually use the asynchronous callbacks, you must be able to guarantee there is no call to the Xrootd module from any python threads as long as there are pending callbacks. It's a pretty high barrier.
Would it be possible to invoke callbacks from a separate thread pool which takes the python GIL first?