classification
Title: Patch for signal.set_wakeup_fd
Type: Stage:
Components: Extension Modules Versions: Python 2.6
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: gvanrossum Nosy List: Rhamphoryncus, georg.brandl, gustavo, gvanrossum
Priority: normal Keywords: patch

Created on 2007-12-10 23:20 by Rhamphoryncus, last changed 2007-12-19 19:41 by gvanrossum. This issue is now closed.

Files
File name Uploaded Description Edit
python2.6-set_wakeup_fd1.diff Rhamphoryncus, 2007-12-10 23:20
python2.6-set_wakeup_fd2.diff Rhamphoryncus, 2007-12-10 23:54
python2.6-set_wakeup_fd3.diff Rhamphoryncus, 2007-12-11 17:25
python2.6-set_wakeup_fd4.diff gvanrossum, 2007-12-18 22:44
Messages (10)
msg58385 - (view) Author: Adam Olsen (Rhamphoryncus) Date: 2007-12-10 23:20
This adds signal.set_wakeup_fd(fd), which allows a single library to be
woken when a signal comes in.
msg58386 - (view) Author: Adam Olsen (Rhamphoryncus) Date: 2007-12-10 23:23
Guido, it looks like I can't alter the Assigned To field.  You get the
Nosy List instead. ;)
msg58387 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-12-10 23:28
Thanks!

Can you add a doc patch too?  Doc/library/signal.rst
msg58392 - (view) Author: Adam Olsen (Rhamphoryncus) Date: 2007-12-10 23:54
version 2, adds to Doc/library/signal.rst.  It also tweaks the
set_wakeup_fd's docstring.

I haven't verified that my formatting in signal.rst is correct. 
Specifically, the '\0' should be checked.
msg58438 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-12-11 16:27
``'\0'`` will be correct.
msg58442 - (view) Author: Adam Olsen (Rhamphoryncus) Date: 2007-12-11 17:25
Thanks georg.
msg58662 - (view) Author: Gustavo J. A. M. Carneiro (gustavo) * Date: 2007-12-15 14:50
The patch looks great.

But I was wondering if there is any chance to export a C API in addition
to the Python one?  That is because PyGTK is mostly C, the code that
needs this is C, it would be easier to call a C API.
msg58663 - (view) Author: Adam Olsen (Rhamphoryncus) Date: 2007-12-15 17:35
The python API has the advantage that you can test for it at runtime,
avoiding a compile-time check.  I don't know if this is significant though.

I don't see the big deal about a C API.  All you need to do is call
PyImport_ImportModule("signal") and PyObject_CallMethod(mod,
"set_wakeup_fd", "i", fd);
msg58784 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-12-18 22:44
Here's an updated patch that applies smoothly to the current trunk.
msg58819 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-12-19 19:41
Committed revision 59574.

I added a simple C API as well, PySignal_SetWakeupFd(fd).

Thanks all!
History
Date User Action Args
2007-12-19 19:41:39gvanrossumsetstatus: open -> closed
resolution: accepted
messages: + msg58819
2007-12-18 22:44:17gvanrossumsetfiles: + python2.6-set_wakeup_fd4.diff
messages: + msg58784
components: + Extension Modules
2007-12-15 17:35:23Rhamphoryncussetmessages: + msg58663
2007-12-15 14:50:32gustavosetnosy: gvanrossum, georg.brandl, Rhamphoryncus, gustavo
2007-12-15 14:50:13gustavosetnosy: + gustavo
messages: + msg58662
2007-12-11 17:25:58Rhamphoryncussetfiles: + python2.6-set_wakeup_fd3.diff
messages: + msg58442
2007-12-11 16:27:48georg.brandlsetnosy: + georg.brandl
messages: + msg58438
2007-12-10 23:54:18Rhamphoryncussetfiles: + python2.6-set_wakeup_fd2.diff
messages: + msg58392
2007-12-10 23:50:16gvanrossumlinkissue1564547 superseder
2007-12-10 23:44:33gvanrossumsetkeywords: + patch, - py3k
2007-12-10 23:44:25gvanrossumsetpriority: normal
2007-12-10 23:28:28gvanrossumsetkeywords: + py3k
assignee: gvanrossum
messages: + msg58387
versions: + Python 2.6
2007-12-10 23:23:16Rhamphoryncussetnosy: + gvanrossum
messages: + msg58386
2007-12-10 23:20:05Rhamphoryncuscreate