Hi. I currently have a problem regarding signals. I'm using pylog (a python - prolog interface) for some generator code which should be creating Zope objects. The problem is the usage of signals in the pylog code, to detect timeouts when waiting for responses from the prolog interpreter. The problem arises with the use of multiple threads where the use of "signal()" is only valid in the main thread. It came to my mind that currently signal handling is going to be implemented in Zope 2.6 afaik (zigg, you are doing this, or am i wrong?) and maybe there is some way to provide an infrastructure on distributing signals to methods in multiple threads or something like that (if possible). Cheers Christian -- Christian Theune - ct@gocept.com gocept gmbh & co.kg - schalaunische strasse 6 - 06366 koethen/anhalt tel.+49 3641 511586 - fax.+49 3496 3099118 mob. - +49 179 7808366 reduce(lambda x,y:x+y,[chr(ord(x)^42) for x in 'zS^BED\nX_FOY\x0b'])
The current Zope head allows you to register an interest in a signal something like: from SignalHandler import SignalHandler import signal SignalHandler.registerHander(signal.SIGHUP, mymethod) HTH, - C ----- Original Message ----- From: "Christian Theune" <ct@gocept.com> To: <zope@zope.org> Sent: Tuesday, July 30, 2002 6:59 AM Subject: [Zope] Signals
Hi.
I currently have a problem regarding signals. I'm using pylog (a python - prolog interface) for some generator code which should be creating Zope objects. The problem is the usage of signals in the pylog code, to detect timeouts when waiting for responses from the prolog interpreter.
The problem arises with the use of multiple threads where the use of "signal()" is only valid in the main thread. It came to my mind that currently signal handling is going to be implemented in Zope 2.6 afaik (zigg, you are doing this, or am i wrong?) and maybe there is some way to provide an infrastructure on distributing signals to methods in multiple threads or something like that (if possible).
Cheers Christian
-- Christian Theune - ct@gocept.com gocept gmbh & co.kg - schalaunische strasse 6 - 06366 koethen/anhalt tel.+49 3641 511586 - fax.+49 3496 3099118 mob. - +49 179 7808366
reduce(lambda x,y:x+y,[chr(ord(x)^42) for x in 'zS^BED\nX_FOY\x0b'])
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Hi. * Chris McDonough <chrism@zope.com> [020730 15:50]:
The current Zope head allows you to register an interest in a signal something like:
from SignalHandler import SignalHandler import signal SignalHandler.registerHander(signal.SIGHUP, mymethod)
Hmm. What I wonder about is: In which thread will the mymethod be callen, and in which context ... the problem with this solution (this came to my mind after posting my question) is the context of the registered hook. This will be the main thread, isn't it? We solved the problem in another way inbetween by rewriting the signal handling procedure of pylog to use select() and popen() which won't be affected by threading issues. (Also it didn't run on windows before, so that's not a problem either.) Thanks for the hint (although HEAD is not what we will be using in this project ...) Cheers Christian -- Christian Theune - ct@gocept.com gocept gmbh & co.kg - schalaunische strasse 6 - 06366 koethen/anhalt tel.+49 3641 511586 - fax.+49 3496 3099118 mob. - +49 179 7808366 reduce(lambda x,y:x+y,[chr(ord(x)^42) for x in 'zS^BED\nX_FOY\x0b'])
participants (2)
-
Chris McDonough -
Christian Theune