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  <20122013  2014  2015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: RE: Invitation to test cothread.catools release candidate
From: <michael.abbott@diamond.ac.uk>
To: <newville@cars.uchicago.edu>
Cc: tech-talk@aps.anl.gov
Date: Thu, 15 Mar 2012 09:36:09 +0000
Hi Matt,

I won't have time for a considered reply for a bit; in particular, I think I'll have to actually write an proper implementation of catools using callbacks for a really considered reply (as I said before, the error handling is particularly troublesome as the flow of control gets scattered), and that's got to wait its turn, maybe a suitable soggy day.

However I think I can sensibly respond to your conclusion straight away.

From: matt.newville@gmail.com [mailto:matt.newville@gmail.com]

> So, if I understand correctly, a principle motivation is that you
> prefer many threads over relying on pre-emptive callbacks.   With that
> preference, thread "weight" becomes a serious issue, so much so that
> you cannot rely on standard python threads.  Is that a fair
> assessment?

Not unfair, though historically slightly backwards: an equally strong motivation is avoiding event callbacks at an inconvenient time.  Or, to reiterate an earlier point, cothread allows the naive, lazy or busy programmer to avoid having to worry about thread synchronisation and locking issues, because diversion of flow of control can only happen at well defined and easy to understand places.  I suspect this is a bigger win than most people realise.

I've just checked with James who did the original work that led up to cothread and cothread.catools and the history is rather interesting: it turns out that the original motivation for using coroutines (or "greenlets" as the library we used called them) was to avoid problems with Qt3 caused by triggering Qt operations from the wrong thread, and this problem was encountered before working on channel access bindings.  In other words, coroutines were introduced precisely to avoid a thread synchronisation problem with Qt.

As for callback driven versus thread driven code, yes, I am arguing that threaded code is clearer, but it does seem that more examples are needed.

-- 
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
 





Replies:
Re: Invitation to test cothread.catools release candidate Matt Newville
References:
Invitation to test cothread.catools release candidate michael.abbott
Re: Invitation to test cothread.catools release candidate Matt Newville
RE: Invitation to test cothread.catools release candidate michael.abbott
Re: Invitation to test cothread.catools release candidate Matt Newville
RE: Invitation to test cothread.catools release candidate michael.abbott
Re: Invitation to test cothread.catools release candidate Matt Newville

Navigate by Date:
Prev: Re: Invitation to test cothread.catools release candidate Matt Newville
Next: EPICS performance evaluation ssahoo
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019 
Navigate by Thread:
Prev: Re: Invitation to test cothread.catools release candidate Matt Newville
Next: Re: Invitation to test cothread.catools release candidate Matt Newville
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·