On 12/4/07 2:56 PM, Kay-Uwe Kasemir wrote:
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
Hi, Kay.
Your example works for me with the PVs hosted on a VME IOC and the
following Linux workstation setup:
* 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
What is your setup?
What happens if you change JNI_THREAD_SAFE to JNI_SINGLE_THREADED?
-lewis
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");
}
}
- References:
- Java CA context cleanup issues on Linux? Kay-Uwe Kasemir
- Navigate by Date:
- Prev:
Re: Multiple IOC Andrew Johnson
- Next:
Re: device support for output connected to volatile device Andrew Johnson
- 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
- Navigate by Thread:
- Prev:
Java CA context cleanup issues on Linux? Kay-Uwe Kasemir
- Next:
Re: Java CA context cleanup issues on Linux? Kay-Uwe Kasemir
- 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
|