Re: [ctypes-users] Memory fault using callable restype
by Chris Liechti other posts by this author
Jul 31 2003 8:17PM messages near this date
Re: [ctypes-users] Memory fault using callable restype
|
[ctypes-users] callbacks, threads and crahes...
Barry, Bob wrote:
> 1) With high transaction volume, we always get a memory fault
> (segmentation violation) or (once) an illegal instruction. When we
> stopped using callable restypes, the problem stopped. Our application is
> multi-threaded, with ctypes calls in two threads, so perhaps callable
> restypes arent thread-safe? This is on a SunOS 5.8. Of course using a
> callable restype is not a necessity.
with "callable restypes" you mean that (snippet from the tutorial):
> >> def ValidHandle(value):
... if value == 0:
... raise WinError()
... return value
...
> >>
> >> GetModuleHandle.restype = ValidHandle
hm. i dont use those, but i also experienced crashes with callbacks and
threads, see my last post from today.
i wrote a little py extensions for the callbacks and that seems to solve
the crashes in our system, altough it would be nice if it would work
with ctypes only.
> 2) What should the restype of a void callback function be? Im using
> c_int for those (as well as other void functions by default) without
> problem, but would like to be certain.
i do the same. would be interesting to know...
chris
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
ctypes-users mailing list
ctypes-users@[...].net
https://lists.sourceforge.net/lists/listinfo/ctypes-users
Thread:
Barry, Bob
Thomas Heller
Thomas Heller
Bob Ippolito
Chris Liechti
|