1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 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 2009 2010 2011 2012 2013 2014 2015 2016 2017 <2018> 2019 2020 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | RE: Are Stream Device protocol clauses atomic? |
From: | Mark Rivers <[email protected]> |
To: | "'Gregory, Ray'" <[email protected]>, "[email protected]" <[email protected]> |
Date: | Mon, 30 Apr 2018 20:44:11 +0000 |
Ø
I would like to know if protocol clauses for Stream Device protocols are atomic. I believe they are atomic with certain caveats: -
Before the “out” command is executed the input stream is flushed. This should remove any stale input. -
The asyn port is locked so that the complete protocol is executed without releasing the lock. This ensures that 2 records cannot interfere. A problem can occur however if the previous command “in” timed out but the device does eventually send the response. If it sends its response after the flush before the next “out” command then the response to that “out” command will be
the previous response, not the expected response. You should set the timeout long enough to prevent this. If you are using any stream device records with SCAN=I/O Intr you must be sure that your protocol consumes all of the input from the device. If not that input could mistakenly be used for another protocol. Mark From: [email protected] [mailto:[email protected]]
On Behalf Of Gregory, Ray I would like to know if protocol clauses for Stream Device protocols are atomic. For example, if one thread is processing clause # /// Read the input curve number getINCRV { out "INCRV? \$1"; in "%d" } and another thread is simultaneously processing (in the same IOC) clause getInputCurveNumber { out "INCRV? \$2"; in "%(\$1)d"; } can these collide and interfere with each other? Or is there a blocking mechanism to help ensure that the ‘in’ of one clause is really the response to the preceding ‘out’ of the same clause? Thank you, --Ray |