Author Marc.Brünink
Recipients Marc.Brünink, docs@python
Date 2013-05-20.00:38:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1369010319.69.0.913023030404.issue18017@psf.upfronthosting.co.za>
In-reply-to
Content
The documentation for is not very clear regarding the usage of CDLL and PyDLL. Especially it is not obvious that you should use PyDLL whenever you call any function of the Python/C API. Since calling a Python/C API function without owning the GIL will most likely cause latent segfaults, I think it warrants a warning box in section 16.17.2.2 and maybe also somewhere prominent in http://docs.python.org/dev/c-api/intro.html.

For section 16.17.2.2 I would put a box next the decription of CDLL saying something like: "The Python GIL is released before a function call. It is not safe to call any Pyhon/C API function within the loaded library without acquiring the GIL first. Thus, if the loaded library calls functions of the Python/C API, for example in case it creates and returns a new Python object, and does not manually acquire and release the GIL, use PyDLL instead."
History
Date User Action Args
2013-05-20 00:38:39Marc.Brüninksetrecipients: + Marc.Brünink, docs@python
2013-05-20 00:38:39Marc.Brüninksetmessageid: <1369010319.69.0.913023030404.issue18017@psf.upfronthosting.co.za>
2013-05-20 00:38:39Marc.Brüninklinkissue18017 messages
2013-05-20 00:38:38Marc.Brüninkcreate