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  2014  2015  2016  2017  2018  2019  2020  <20212022  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  <20212022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: QuadEM operation with parameters "Queued"
From: Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To: Iain Marcuson <iain.marcuson at sydortechnologies.com>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Thu, 21 Oct 2021 14:13:38 +0000

Hi Iain,

 

asyn does queue both write and read operations if you create your driver with the ASYN_CANBLOCK flag.  Did you do that?

 

How does your polling record work, i.e. is it going through your quadEM driver and then the underlying drvAsynIPPort driver?

 

Changing parameter A and having no message sent does not make sense to me unless the asyn queueRequest is timing out.  Are there any messages on the IOC console when this happens?

 

> All writes, which includes the 1 Hz record mentioned above, write to the same shared buffer that is then sent, so might there be contention there?

 

Does your polling record write to a record which then results in your driver's writeOctet or similar method being called?  If so, then it should be OK because if you set ASYN_CANBLOCK then both the drvAsynIPPort driver lock, and the asynPortDriver lock for your quadEM driver will be held when writeOctet is called.  If you then write to the shared buffer and immediately call the underlying drvAsynIPPort->write() function then it should not be possible for 2 threads to be trying to use the shared buffer at the same time.

 

Mark

 

 


From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Iain Marcuson via Tech-talk <tech-talk at aps.anl.gov>
Sent: Thursday, October 21, 2021 8:52 AM
To: tech-talk at aps.anl.gov
Subject: QuadEM operation with parameters "Queued"

 

I am working on writing a new IOC for QuadEM device, and the IOC mostly works.  The IOC talks over TCP via asyn to a middle software layer that talks to the hardware.  The middle layer can send unsolicited messages to EPICS, so I implemented polling by having a record scan once a second and read the port.  Sometimes, however, I get a case where EPICS seems to be queueing writes, so I would get

Change parameter A -> No message send

Change parameter B -> Send A

Change parameter C -> Send B

 

All writes, which includes the 1 Hz record mentioned above, write to the same shared buffer that is then sent, so might there be contention there?

 

Thank you,

 

Iain Marcuson

Software Engineer, Sydor Technologies

585.278.1168 | www.SydorTechnologies.com

Skype: iain.marcuson at sydorinstruments.com

 

 

This message has been scanned for malware by Forcepoint. www.forcepoint.com


Replies:
RE: QuadEM operation with parameters "Queued" Iain Marcuson via Tech-talk
References:
QuadEM operation with parameters "Queued" Iain Marcuson via Tech-talk

Navigate by Date:
Prev: QuadEM operation with parameters "Queued" Iain Marcuson via Tech-talk
Next: RE: QuadEM operation with parameters "Queued" Iain Marcuson via Tech-talk
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  <20212022  2023  2024 
Navigate by Thread:
Prev: QuadEM operation with parameters "Queued" Iain Marcuson via Tech-talk
Next: RE: QuadEM operation with parameters "Queued" Iain Marcuson via Tech-talk
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  <20212022  2023  2024 
ANJ, 21 Oct 2021 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·