EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Cothread and Python catools release
From: Michael Abbott <[email protected]>
To: EPICS Tech Talk <[email protected]>
Cc: [email protected], [email protected]
Date: Fri, 6 Nov 2009 15:02:07 +0000 (GMT)
About a month ago we had a long and interesting conversation about 
alternative Python channel access bindings, and I see that the topic of Qt 
bindings has now come up: I'd like to point out that cothread also 
provides PyQt and CA integration.

I've tried to take account of the easy fixes to cothread.catools arising 
from our earlier discussions, including a number of bug fixes and 
suggestions, and I offer a 1-15 cothread release, which can be downloaded 
from

	http://controls.diamond.ac.uk/downloads/python/cothread/

Forgive me: this release is not thorougly tested, I wanted to make it 
visible sooner rather than later.


So what's new in this release?

1. Fixed some interesting bugs on 64-bit Linux observed by Juan Guzman.  
This was mostly a matter of getting the ctypes definitions right.  I've 
also tried to ensure that the automatic conversions work properly on 
64-bit systems, but this needs more testing.

2. Added support for four somewhat cryptic DBR_ features: 
DBR_STSACK_STRING, DBR_CLASS_NAME (caget & camonitor only) and 
DBR_PUT_ACKT, DBR_PUT_ACKS (caput only).  Easy enough to implement, so 
they're there in case they're useful.

3. Added support for automatically converting between arrays of char and 
strings: this is implemented through a new "fake" DBR_CHAR_STR value which 
triggers some special case processing.

4. Added option for DBE_PROPERTY monitoring.

5. caget([]) no longer causes an exception, instead an empty list is 
returned (and similarly for the other functions).

6. Channel properties can now be interrogated, by calling 
info = connect(pv,cainfo=True) and inspecting or printing info.

7. The implementation of input_hook._readline_hook() has been rather 
drastically simplified.  This may have uncomfortable side effects...

You'll find the detailed documentation of the catools API at
	http://controls.diamond.ac.uk/downloads/python/cothread/1-15/docs/catools.html


I offer cothread.catools as a fully featured and easy to use channel 
access library, but I understand that the cothread underpinnings can be 
controversial.  I am aware of existing weaknesses, and I'd like to work on 
improving things.  Here are my thoughs of areas that need more work:

1. Packaging of the cothread library is rather horrible.  To actually use 
this, the first thing you need to do is edit line 55 of cothread/cadef.py 
to point to your own libca.so.  I'd welcome a better packaging!

2. The underlying coroutine mechanism is based on greenlets which work by 
reusing the common stack by copying stack frames to and from the heap.  
I'm not happy with this, in particular it breaks polling with timers with 
Qt4 (so a different polling mechanism is used).  This needs closer 
examination.

3. Is it possible, perhaps, to decouple cothread.catools from cothreads 
altogether?  I'm not sure about this, as I make some essential use of 
coding tricks that only cothreads allow, but it could be worth a closer 
look.

4. Framework integration needs to be more developed.  At the moment Qt, 
readline and CA integration are present and work well enough, but things 
could be done more smoothly, and other probably other framework 
integrations would be useful.

5. Control-C handling ... um ... needs work.  Unfortunately Python's 
(default?) handling of control-C is bad news anyway: injecting exceptions 
into code which never otherwise sees them is a recipe for Heisenbugs!

Navigate by Date:
Prev: Re: QtCATool Steven M. Hartman
Next: RE: Next generation EPICS display manager Dalesio, Leo
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: FW: Next generation EPICS display manager Zhichu Chen
Next: Re: Qt edm John William Sinclair
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 31 Jan 2014 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·