cothread

This module contains Python bindings for Channel Access using lightweight Python threads

A git repository containing work in progress for cothread can be cloned by running the command:

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

Note that cothread will work to some extent on 32-bit windows, but the extension libraries need to be built with mingw32 using the command

python setup.py build_ext -i --compiler=mingw32

Python 3 is now supported by cothread: either check out the python3 branch from the repository or apply the appropriate 2to3 patch from the release.

Contact

contact

Releases

Version iconSource Code iconDocumentation
2-12 iconcothread-2-12.tgz, Python 3 patch: cothread-2-12-2to3.patch iconindex
2-11a iconcothread-2-11a.tgz, Python 3 patch: cothread-2-11a-2to3.patch iconindex
2-11-beta iconcothread-2-11-beta.tgz, Python 3 patch: cothread-2-11-beta-2to3.patch iconindex
2-8 iconcothread-2-8.tgz, Python 3 patch: cothread-2-8-2to3.patch iconindex
2-7 iconcothread-2-7.tgz, Python 3 patch: cothread-2-7-2to3.patch iconindex
2-6 iconcothread-2-6.tgz, Python 3 patch: cothread-2-6-2to3.patch iconindex
2-3 iconcothread-2-3.tgz iconindex
2-2 iconcothread-2-2.tgz iconindex
2-0 iconcothread-2-0.tgz iconindex
1-15 iconcothread-1-15.tgz iconindex
1-14 iconcothread-1-14.tgz iconindex
1-12 iconcothread-1-12.tgz iconindex

Release Notes

Release 2-12

  • Substantial enhancements to socket server support to ensure that the built-in Python socket server libraries work seamlessly with cothread.

Release 2-11a

  • Fixes bug in DBR_CHAR_STR and DBR_CHAR_UNICODE conversion introduced by a refactoring error in 2-11-beta. Note, there is a 2-11 release tag in git, but it doesn't include this fix.
  • Small changes to PV_array class.

Release 2-11-beta

  • Rework mechanism for locating libca library, including override mechanism suggested by Lingyun Yang and removing reliance on environment variables when identifying the architecture.
  • Miscellaneous small changes: ca_arrays are now unhashable, pvtree knows about aSub, etc.
  • Add Valgrind annotations to coroutine switching code. You can now get sensible results when running cothread with Valgrind.
  • Add new Pulse event object for pthread style event notification.
  • Manage lifetimes of subscriptions more carefully. Ensure that camonitor subscriptions are closed even if the connection never fully completed, but ensure we don't close the subscription *too* soon to work around an EPICS synchronisation bug.
  • Add connection timeout to camonitor to notify if connection never completes.
  • Revisit handling of int request on 64-bit platforms. For practical reasons this is now treated as a 32-bit request even when a 64-bit value appears to be being requested ... because we have no choice.
  • Add new PV and PV_array classes. These are still somewhat experimental, so expect API changes in the future.
  • Make returned data shape depend on length of underlying source. This can result in an incompatible change: the result from caget(pv,count=1) is now scalar or vector depending on the shape of the original pv.

Release 2-8

  • Add new datatype option DBR_ENUM_STR to fetch enums as strings but other types as their default types.
  • Fix mostly trivial bug in disconnect handling.

Release 2-7

  • Fix regression on handling of strings in calls to caput(): now let the IOC do the string conversion if no datatype specified, this allows enumerations to be written as strings.

Release 2-6

  • Implement Python 3 support. This is currently maintained as a separate branch in the git repository which is repeatedly rebased onto the main Python 2 development branch.
  • Use asynchronous Channel Access notification. This reduces the risk of losing channel access events and increases the carrying capacity of channel access. Note that camonitor callbacks are still delivered synchronously to users.
  • Fix Qt4 readline hook bug.
  • Fix OSX compatibility, broken in earler release.
  • Fix bug in EPICS epoch correction.
  • Add datetime property to values where appropriate.
  • Add support for explicit Unicode support in catools, and correspondingly, add support for bytes in Python 3.
  • Improve default event mask for camonitor.
  • Floating point state is now maintained per cothread.
Do not use releases 2-4 or 2-5, they are broken: caput()s don't complete immediately! This is due to a missing ca_flush_io() call.

Release 2-3

  • Support for Qt version 3 dropped. Do let me know if this is a problem, but dropping this allows things to be considerably simplified.
  • iqt() no longer has a use_timer option, the default behaviour is now the only supported behaviour. This incompatible change should cause no observable impact, but do let me know if it does.
  • Cothread can now be used in the presence of an existing Qt event loop by calling iqt(run_exec=False). This allows, for example, plugins for Qt designer to use cothread.

Release 2-2

  • Fix implementation of Timer.reset

Release 2-1

  • Documentation rewritten using Sphinx
  • Semantics of expired timeouts changed to avoid starvation
  • Timer .reset() method implemented
  • Cothread compatible socket wrapper implemented.

Release 2-0

  • Eliminate greenlet dependency
  • Many other internal changes.

Release 1-15

  • Latest release