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 2025 | 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 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Java CA context cleanup issues on Linux? |
From: | "J. Lewis Muir" <[email protected]> |
To: | tech talk <[email protected]> |
Date: | Tue, 04 Dec 2007 15:38:58 -0500 |
Hi:
The code below uses JCA to do a simple context setup, PV connection, cleanup. Then the same again.
On Linux, that second time around results in "pthread_create error Invalid argument" errors in the createChannel() call.
On OS X it works OK. The same code also works OK when using CAJ instead of the JNI version of the ChannelAccess client lib. Haven't tried Windows.
Any ideas?
Thanks, -Kay
* Dual Intel Xeon 2.8 GHz w/ hyper-threading enabled * Red Hat Enterprise Linux WS release 3 (Taroon Update 9) * EPICS 3.14.8.2 * JCA 2.3.1 * Sun's jdk1.5.0_12
import gov.aps.jca.Channel; import gov.aps.jca.Context; import gov.aps.jca.JCALibrary;
/** Test JCA context setup and cleanup. */
public class JCAContextTest
{ /** Test run: Setup, connect, cleanup */
private void run(final String pv_name) throws Exception
{
final JCALibrary jca = JCALibrary.getInstance();
// Select JCA
final Context context = jca.createContext(JCALibrary.JNI_THREAD_SAFE);
final Channel pv = context.createChannel(pv_name); context.pendIO(5.0); pv.dispose();
context.dispose();
}
public static void main(final String[] args) throws Exception
{
// First test runs OK
final JCAContextTest test = new JCAContextTest();
test.run("ramp1");
// Second time, different PV or not, results in
// ""
// pthread_create error Invalid argument
// CAC: Unexpected exception during virtual circuit creation
// ""
// on Linux.
// On OS X, it's fine.
System.out.println("Trying again:");
test.run("ramp2");
}
}