RE: [Zope] Auto restart (at Zope's own initiative !!!)
Actually, I posted the dll and 3 test scripts (the two here, plus one non-threaded) to the sourceforge site, hoping for either a clue or a bugfix. I think I did use the extending/embedding doc you sited, along with the O'Reilly books, when I was teaching myself to write extensions. I don't recall anything much related to threading, except Py_BEGIN/END_ALLOW_THREADS, which I think just deals with blocking, which I suspect is a different (and irrelevent?) issue here. C's not my best language, so I'm always a bit suspicious of my C-code when dealing with something even remotely interesting. ---------- Keith J. Farmer kfarmer@thuban.org http://www.thuban.org -----Original Message----- From: Chris McDonough [mailto:chrism@zope.com] Sent: Monday, January 28, 2002 17:05 It might be time to ask this question on the Python maillist (unless you've already done that).
suspect the environment that's setting up the thread -- Python, in this
It's possible. But good programmers suspect everything before they suspect their tools, so I'd certainly keep an open mind. ;-)
Keith J. Farmer wrote:
Actually, I posted the dll and 3 test scripts (the two here, plus one non-threaded) to the sourceforge site, hoping for either a clue or a bugfix.
Oh ok. It might be a good idea to post to comp.lang.python as well; lots of folks are very helpful there.
I think I did use the extending/embedding doc you sited, along with the O'Reilly books, when I was teaching myself to write extensions. I don't recall anything much related to threading, except Py_BEGIN/END_ALLOW_THREADS, which I think just deals with blocking, which I suspect is a different (and irrelevent?) issue here.
Maybe... it really smells like a memory corruption issue or the dereference of a null pointer or something, though.
C's not my best language, so I'm always a bit suspicious of my C-code when dealing with something even remotely interesting.
I'm a very poor C programmer as well (I can barely code anything in C), so I understand totally. - C
Actually, I posted the dll and 3 test scripts (the two here, plus one non-threaded) to the sourceforge site, hoping for either a clue or a bugfix.
I think I did use the extending/embedding doc you sited, along with the O'Reilly books, when I was teaching myself to write extensions. I don't recall anything much related to threading, except Py_BEGIN/END_ALLOW_THREADS, which I think just deals with blocking, which I suspect is a different (and irrelevent?) issue here.
Thread blocking _is_ relevant if the .dll you are calling is not reentrant. You really need to refer to the documented thread behavior / requirements of the dll you are trying to interface to - there is no magic right answer on the Python end. What you need to do in your C extension depends totally on the internals of the dll you are calling. While it may be worth a shot to post your problem to comp.lang.python to try to get help from other C extension writers, they will probably not be able to help much either without knowing more about the threading constraints of the particular dll you are working with. Your best bet right now is to contact the maintainers of that dll (or read their developer docs) and find out what kinds of threading issues apply. Brian Lloyd brian@zope.com Software Engineer 540.361.1716 Zope Corporation http://www.zope.com
participants (3)
-
Brian Lloyd -
Chris McDonough -
Keith J. Farmer