From: <so...@sy...> - 2004-11-10 14:30:27
|
Hi Arjen, I am trying to open up more than one plot. It looks like octave binding does allows this but I have not been able to do it so far. I am using one thread per plot. Is there any example or sample explaining how to launch multiple plots? I tried the following test program. /* * Created on Nov 5, 2004 * */ package plplot.examples; import plplot.core.PLStream; /** * @author Ali * */ public class Test extends Thread { static { System.load("c:\\jmatlab\\jmatlab\\jplplot.dll"); } public void run() { PLStream pls = new PLStream(); pls.sdev("win3"); pls.init(); double[] x = new double[] {1.0, 2.0, 3.0}; double[] y = new double[] {1.0, 2.0, 3.0}; pls.col0(1); pls.env(0.0, 10.0, 0.0, 10.0, 0, 1); pls.col0(2); pls.poin(x, y, 0); pls.flush(); pls.end1(); } public static void main(String[] args) { Test t = new Test(); t.start(); t = new Test(); t.start(); } } In run mode only one one shows up and when I close the window I get following error message. *** PLPLOT ERROR *** plcol0: Please call plinit first, aborting operation *** PLPLOT ERROR *** plenv: Please call plinit first, aborting operation *** PLPLOT ERROR *** plcol0: Please call plinit first, aborting operation *** PLPLOT ERROR *** plpoin: Please set up window first, aborting operation *** PLPLOT ERROR *** plcol0: Please call plinit first, aborting operation *** PLPLOT ERROR *** plstyl: Please call plinit first, aborting operation *** PLPLOT ERROR *** plpat: Please call plinit first, aborting operation In the debug mode, it shows both plots and one closing them I get following errors An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x1D1B34FF Function=[Unknown.] Library=C:\jmatlab\jmatlab\jplplot.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at plplot.core.plplotjavacJNI.plend1(Native Method) at plplot.core.plplotjavac.plend1(plplotjavac.java:74) at plplot.core.PLStream.end1(PLStream.java:193) at plplot.examples.Test.run(Test.java:30) Dynamic libraries: 0x00400000 - 0x00407000 C:\Program Files\Java\j2re1.4.2_03\bin\javaw.exe 0x77F80000 - 0x77FFD000 C:\WINNT\system32\ntdll.dll 0x7C2D0000 - 0x7C332000 C:\WINNT\system32\ADVAPI32.dll 0x7C570000 - 0x7C623000 C:\WINNT\system32\KERNEL32.DLL 0x77D30000 - 0x77DA1000 C:\WINNT\system32\RPCRT4.DLL 0x77E10000 - 0x77E75000 C:\WINNT\system32\USER32.dll 0x77F40000 - 0x77F7B000 C:\WINNT\system32\GDI32.DLL 0x78000000 - 0x78046000 C:\WINNT\system32\MSVCRT.dll 0x75E60000 - 0x75E7A000 C:\WINNT\system32\IMM32.DLL 0x6CA60000 - 0x6CA68000 C:\WINNT\system32\LPK.DLL 0x66650000 - 0x666A4000 C:\WINNT\system32\USP10.dll 0x08000000 - 0x08138000 C:\Program Files\Java\j2re1.4.2_03\bin\client\jvm.dll 0x77570000 - 0x775A0000 C:\WINNT\system32\WINMM.dll 0x10000000 - 0x10007000 C:\Program Files\Java\j2re1.4.2_03\bin\hpi.dll 0x007F0000 - 0x007FE000 C:\Program Files\Java\j2re1.4.2_03\bin\verify.dll 0x00800000 - 0x00819000 C:\Program Files\Java\j2re1.4.2_03\bin\java.dll 0x00820000 - 0x0082D000 C:\Program Files\Java\j2re1.4.2_03\bin\zip.dll 0x18170000 - 0x1818C000 C:\Program Files\Java\j2re1.4.2_03\bin\jdwp.dll 0x1C190000 - 0x1C195000 C:\Program Files\Java\j2re1.4.2_03\bin\dt_socket.dll 0x75030000 - 0x75043000 C:\WINNT\system32\ws2_32.dll 0x75020000 - 0x75028000 C:\WINNT\system32\WS2HELP.DLL 0x1C1A0000 - 0x1C1AA000 C:\Program Files\Aventail\Connect\asnsp.dll 0x1C2C0000 - 0x1C2CD000 C:\Program Files\Aventail\Connect\amtshr32.dll 0x1C3E0000 - 0x1C3F3000 C:\Program Files\Aventail\Connect\pso32.dll 0x75050000 - 0x75058000 C:\WINNT\system32\WSOCK32.dll 0x76620000 - 0x76630000 C:\WINNT\system32\MPR.dll 0x1C510000 - 0x1C5D2000 C:\Program Files\Aventail\Connect\asres.dll 0x1C5E0000 - 0x1C5EE000 C:\Program Files\Aventail\Connect\s5log.dll 0x30400000 - 0x30425000 C:\Program Files\Aventail\Connect\cfglib32.dll 0x30300000 - 0x3031E000 C:\Program Files\Aventail\Connect\ccache32.dll 0x76B30000 - 0x76B6D000 C:\WINNT\system32\comdlg32.dll 0x63180000 - 0x631E4000 C:\WINNT\system32\SHLWAPI.DLL 0x71780000 - 0x7180A000 C:\WINNT\system32\COMCTL32.DLL 0x782F0000 - 0x78535000 C:\WINNT\system32\SHELL32.DLL 0x782C0000 - 0x782CC000 C:\WINNT\System32\rnr20.dll 0x77980000 - 0x779A4000 C:\WINNT\system32\DNSAPI.DLL 0x77340000 - 0x77353000 C:\WINNT\system32\iphlpapi.dll 0x77520000 - 0x77525000 C:\WINNT\system32\ICMP.DLL 0x77320000 - 0x77337000 C:\WINNT\system32\MPRAPI.DLL 0x75150000 - 0x7515F000 C:\WINNT\system32\SAMLIB.DLL 0x75170000 - 0x751BF000 C:\WINNT\system32\NETAPI32.DLL 0x77BE0000 - 0x77BEF000 C:\WINNT\system32\SECUR32.DLL 0x751C0000 - 0x751C6000 C:\WINNT\system32\NETRAP.DLL 0x77950000 - 0x77978000 C:\WINNT\system32\WLDAP32.DLL 0x77A50000 - 0x77B3F000 C:\WINNT\system32\OLE32.DLL 0x779B0000 - 0x77A4B000 C:\WINNT\system32\OLEAUT32.DLL 0x773B0000 - 0x773DE000 C:\WINNT\system32\ACTIVEDS.DLL 0x77380000 - 0x773A2000 C:\WINNT\system32\ADSLDPC.DLL 0x77830000 - 0x7783E000 C:\WINNT\system32\RTUTILS.DLL 0x77880000 - 0x7790D000 C:\WINNT\system32\SETUPAPI.DLL 0x7C0F0000 - 0x7C151000 C:\WINNT\system32\USERENV.DLL 0x774E0000 - 0x77512000 C:\WINNT\system32\RASAPI32.DLL 0x774C0000 - 0x774D1000 C:\WINNT\system32\RASMAN.DLL 0x77530000 - 0x77552000 C:\WINNT\system32\TAPI32.DLL 0x77360000 - 0x77379000 C:\WINNT\system32\DHCPCSVC.DLL 0x777E0000 - 0x777E8000 C:\WINNT\System32\winrnr.dll 0x1CD90000 - 0x1CDA7000 C:\WINNT\system32\Hummingbird\Connectivity\7.00\Socks\hclsock5.dll 0x777F0000 - 0x777F5000 C:\WINNT\system32\rasadhlp.dll 0x74FD0000 - 0x74FED000 C:\WINNT\system32\msafd.dll 0x75010000 - 0x75017000 C:\WINNT\System32\wshtcpip.dll 0x1D180000 - 0x1D1CD000 C:\jmatlab\jmatlab\jplplot.dll 0x60000000 - 0x60045000 C:\WINNT\system32\MSCTF.dll 0x1D550000 - 0x1D557000 C:\Program Files\Lotus\SameTime Client\autoaway.dll 0x77920000 - 0x77943000 C:\WINNT\system32\imagehlp.dll 0x72A00000 - 0x72A2D000 C:\WINNT\system32\DBGHELP.dll 0x690A0000 - 0x690AB000 C:\WINNT\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 237K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 46% used [0x10010000, 0x1004b5d0, 0x10090000) from space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) to space 64K, 0% used [0x100a0000, 0x100a0000, 0x100b0000) tenured generation total 1408K, used 0K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 0% used [0x104f0000, 0x104f0000, 0x104f0200, 0x10650000) compacting perm gen total 4096K, used 1084K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 26% used [0x14010000, 0x1411f368, 0x1411f400, 0x14410000) Local Time = Wed Nov 10 09:16:10 2004 Elapsed Time = 13 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid1788.log. # Please refer to the file for further information. # ----- Original Message ----- From: "Arjen Markus" <arj...@wl...> To: "Ali Muhammad" <so...@sy...> Cc: <plp...@li...> Sent: Wednesday, November 10, 2004 2:36 AM Subject: Re: [Plplot-general] Is PLPlot thread safe? > Ali Muhammad wrote: > > > > Hi, > > > > I am using java binding on windows. I span a new thread for a plot. I was > > wondering if the C code is thread safe. > > > > Please advise > > > > Regards, > > > > -Ali > > > > Ali, > > as long as you are using Plplot in one thread only, there should be no > problem. Any problems would come from spawning a thread per plot ... > I have seen code fragments in some drivers that take care of the > multithreaded situation, but not in the Windows driver. > > It might be interesting to see how that one behaves in such an > environment. > > Regards, > > Arjen > > |