EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  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  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Java CA context cleanup issues on Linux?
From: Kay-Uwe Kasemir <[email protected]>
To: tech talk <[email protected]>
Date: Tue, 04 Dec 2007 14:56:39 -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




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");
	}
}

Replies:
Re: Java CA context cleanup issues on Linux? J. Lewis Muir

Navigate by Date:
Prev: Multiple IOC Robert Emery
Next: Re: Multiple IOC Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Multiple IOC Robert Emery
Next: Re: Java CA context cleanup issues on Linux? J. Lewis Muir
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Nov 2011 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·