ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> ctypes-users
ctypes-users
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 aren’t 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? I’m 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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved