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: | Multi-threaded CAJ Example |
From: | Ryan Slominski <[email protected]> |
To: | [email protected] |
Date: | Mon, 08 Aug 2011 12:05:34 -0400 |
Hello,Could anyone provide a multi-threaded Channel Access Java (CAJ) example? The closest thing I could find was the JCA tutorial (http://www.aps.anl.gov/bcda/jca/jca/2.1.2/tutorial.html), but this is single threaded, and JCA. I'm new to CAJ and EPICS.
I've created a web application that uses CAJ, but the performance is lack-luster. I've identified the bottleneck as the destruction of the context object, which oddly takes over a second (the initialization and CA get is actually fast - just a few milliseconds). Each client web request is serviced in its own thread and creates a new context and then destroys the context within the request.
Some things I am considering to get around the high cost of destroying a context is sharing a single context across all client requests (It appears I'd have to serialize myself; won't scale), or creating a context pool.
Thanks for your time, Ryan Slominski Thomas Jefferson National Accelerator Facility