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  2009  2010  2011  2012  2013  <20142015  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  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: EPICS Python Question
From: <[email protected]>
To: <[email protected]>, <[email protected]>, <[email protected]>
Date: Tue, 30 Sep 2014 13:31:41 +0000
From: Kasemir, Kay [mailto:[email protected]]
> For SNS beam line updates we started using cothread, but now prefer
> https://pypi.python.org/pypi/CaChannel
> 
> cothread has a very nice API, but it uses its own type of cooperative
> threads which prohibit use of plain python threads.

THIS IS NOT TRUE.

Cothreads and plain threads interact in a particular way which requires careful understanding.  In particular, the cothread API can only be used from one thread -- it is not possible to perform a cothread blocking operation in another thread, and it's not safe (at present) to perform a cothread wakeup from another thread.

The current cothread way is to do all the cothread work in a thread dedicated to cothread and to use the mechanisms provided by cothread for communicating with other threads.

Michael Davidsaver and I have briefly discussed providing deeper support in cothread for multiple threads, but so far it's not been very clear to me what the requirements are.  

> We need to use both a CA client and a CA server
> (http://code.google.com/p/pcaspy/) within the same python program, and
> would like to have the option of using additional python libraries
> which in turn might create their own threads. So far, we found no
> issues when combining pcaspy and CaChannel within the same python
> program.

What issues have you encountered when using cothread in this context?  If you wish to call into cothread from another thread I suggest in the first instance using the Callback() mechanism.


-- 
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. 
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
 





References:
EPICS Python Question Elder Matias
Re: EPICS Python Question Kasemir, Kay

Navigate by Date:
Prev: Re: EPICS Python Question Shen, Guobao
Next: RE: EPICS Python Question michael.abbott
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: EPICS Python Question Elder Matias
Next: Recommendations for high-power electrically quiet stepper motor driver Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 17 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·