#364 closed defect (fixed)
Use the "full" Python thread API
Reported by: | Olly Betts | Owned by: | Olly Betts |
---|---|---|---|
Priority: | normal | Milestone: | 1.3.0 |
Component: | Xapian-bindings (Python) | Version: | SVN trunk |
Severity: | normal | Keywords: | |
Cc: | dnsauve@…, alex@… | Blocked By: | |
Blocking: | Operating System: | All |
Description
This bug is essentially "son of #185".
Most of the issues in that ticket are fixed, but the requirement to run Xapian-using code in the main interpreter when using mod_python or mod_wsgi remains.
Mark Hammond gives a good summary of what needs doing for this in comment:ticket:185:3 - essentially we would need to use the full Python thread API and keep a reference to "our" Python interpreter in thread local storage.
I think doing this won't require modifications to SWIG (though perhaps we should ultimately offer a patch to SWIG to provide this as an option) - you can override what SWIG uses in the blocking/allowing thread begin/end boilerplate, so I think someone "just" needs to write suitable replacements which store the interpreter in thread local storage which we can plug in to our interface files.
Attachments (2)
Change History (11)
comment:1 by , 15 years ago
Cc: | added |
---|
comment:2 by , 15 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:3 by , 15 years ago
Cc: | added |
---|
comment:4 by , 14 years ago
Component: | Xapian-bindings → Xapian-bindings (Python) |
---|
comment:5 by , 14 years ago
Milestone: | → 1.2.x |
---|---|
Version: | 1.1.0 → SVN trunk |
This should cause any incompatibilities for existing code using the Python bindings, so marking as suitable for 1.2.x.
by , 13 years ago
Attachment: | python-multiinterpreter-locking.patch added |
---|
Patch to implement locking using the "full" thread API
comment:6 by , 13 years ago
Milestone: | 1.2.x → 1.3.0 |
---|
This patch against current trunk works for the single interpreter case - I've not tested it in the multiple interpreter case yet, but I think it's at least along the right lines.
The patch also tweaks pythontest2.py to use threads so that the thread locking actually does something.
Marking for 1.3.0 - assuming this patch (or something like it) works, fixing this in 1.3.0 should give us plenty of time to shake out any problems.
by , 13 years ago
Attachment: | python.i-diff-against-reformatted-original.patch added |
---|
patch against reformatted original to show actual changes better
comment:7 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Applied to trunk with some additional changes in r16201.
comment:8 by , 12 years ago
I have tested this and it works ok for multiple interpreter case also.
Kind regards.
julefrokost.
milestone changed from 1.2.x to 1.3.0 This patch against current trunk works for the single interpreter case - I've not tested it in the multiple interpreter case yet, but I think it's at least along the right lines.
This patch against current trunk works for the single interpreter case - I've not tested it in the multiple interpreter case yet, but I think it's at least along the right lines. julefrokost
The patch also tweaks pythontest2.py to use threads so that the thread locking actually does something.
comment:9 by , 12 years ago
julefrokost: This patch has already been included on trunk and in the 1.3.0 development release - are you just providing additional testing info, or are you suggesting these changes should get backported to 1.2.x? If so, which Xapian version did you test with and what tests did you do?
Fixing status - was closed by spammer.