Thread.start called but threads not available

2002-11-18 Thread Jacques Grelet
Hi,

I have compiled a java source with gcj under cygwin on win2000:
gcj -o serveur --main=serveur serveur.java
The programme gave the following message about threads not available, but 
gcc seems to be compiled with threads enable.
Why ?

Thanks for help,

[jgrelet]:/s/outils/sources/serveur> ./serveur 10183

Serveur version java 1.1 port UDP : 10183


Exception in thread "main" java.lang.InternalError: Thread.start called but 
threads not available

[jgrelet]:/s/outils/sources/serveur> gcc -v
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.2/specs
Configured with: /netrel/src/gcc-3.2-3/configure 
--enable-languages=c,c++,f77,java --enable-libgcj --enable-threads=posix 
--with-system-zlib --enable-nls --without-included-gettext 
--enable-interpreter --disable-sjlj-exceptions 
--disable-version-specific-runtime-libs --enable-shared 
--build=i686-pc-linux --host=i686-pc-cygwin --target=i686-pc-cygwin 
--enable-haifa --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc 
--libdir=/usr/lib --includedir=/nonexistent/include --libexecdir=/usr/sbin
Thread model: posix
gcc version 3.2 20020927 (prerelease)

Source code is :
/* serveur.javaJ Grelet juillet 98

   Test de reception de trames ethernet
*/

import java.awt.*;
import java.io.*;
import java.net.*;
import java.lang.*;
import java.applet.*;
import java.util.Date;

/
 /
public class serveur {
  static int PortNumber;

  public static void main( String argv[] ) {
try {
  PortNumber = Integer.valueOf( argv[ 0 ] ).intValue();
}
catch( ArrayIndexOutOfBoundsException e ) {
  System.out.println( "\nusage : java serveur \n" );
  System.exit( 0 );
}
System.out.println( "\nServeur version java 1.1 port UDP : " +
   PortNumber + "\n\n" );
try {
  DatagramSocket sd = new DatagramSocket( PortNumber );
  receive rcv = new receive( sd );
  rcv.start();
}
catch( SocketException se ) {
  System.err.println( se );
}
  }
}

/
 /
class receive extends Thread {

  DatagramSocket sd;
  protected DatagramPacket pd;

  static byte[] buffer = new byte[ 1024 ];

  public receive( DatagramSocket s ){
sd = s;
 }

/
 /
  public void run() {

while( true ) {
try {
  pd = new DatagramPacket( buffer, buffer.length );
  sd.receive( pd );
  String s = new String( pd.getData(),0,pd.getLength()-2, "8859_1" );
  System.out.println( s );
  Thread.yield();  // le thread cede sa place au suivant
}
catch( IOException e ){
System.err.println( e );
  }
} // fin de la boucle while
  }
}


Jacques Grelet

Email: [EMAIL PROTECTED]




--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Thread.start called but threads not available

2002-11-18 Thread Randall R Schulz
Jacques,

I don't know how much of the Gnu Compiler for Java shares with the Gnu C 
and C++ compilers, but why do you assume that availability of threading in 
"gcc" implies that Java threads will be available via "gcj?"


Moreover, why are you using "gcj" at all? Is there a reason the Sun J2SDK 
is unacceptable? It is far more mature and is eminently usable under 
Cygwin. I do a lot of Java work these days, so I'd be interested in hearing 
what is the appeal of gcj.


The following paragraph was included in Chris Faylor's the release 
announcement for gcc 3.2.1 (Subject: "[ANNOUNCEMENT] Updated/new: gcc 
3.2-1, gcc2-2.95.3-10, gcc-mingw-3.2-20020817-1"; Date: "Tue, 15 Oct 2002 
17:06:20 -0400 (EDT)"):

gcc 3.2-1 contains gcj which various people have reported as being either 
functional or broken.  I'll probably strip it out of future releases and 
offer it separately.


It seems that under Cygwin at least, "gcj" might not be ready for 
production use.


Randall Schulz
Mountain View, CA USA


At 08:04 2002-11-18, Jacques Grelet wrote:
Hi,

I have compiled a java source with gcj under cygwin on win2000:
gcj -o serveur --main=serveur serveur.java
The programme gave the following message about threads not available, but 
gcc seems to be compiled with threads enable.
Why ?

Thanks for help,

[jgrelet]:/s/outils/sources/serveur> ./serveur 10183

Serveur version java 1.1 port UDP : 10183


Exception in thread "main" java.lang.InternalError: Thread.start called 
but threads not available

[jgrelet]:/s/outils/sources/serveur> gcc -v
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.2/specs
Configured with: /netrel/src/gcc-3.2-3/configure 
--enable-languages=c,c++,f77,java --enable-libgcj --enable-threads=posix 
--with-system-zlib --enable-nls --without-included-gettext 
--enable-interpreter --disable-sjlj-exceptions 
--disable-version-specific-runtime-libs --enable-shared 
--build=i686-pc-linux --host=i686-pc-cygwin --target=i686-pc-cygwin 
--enable-haifa --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc 
--libdir=/usr/lib --includedir=/nonexistent/include --libexecdir=/usr/sbin
Thread model: posix
gcc version 3.2 20020927 (prerelease)

Source code is :
...


Jacques Grelet

Email: [EMAIL PROTECTED]


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/




GCJ Thread.start called but threads not available

2003-01-24 Thread Bart Lamot
Hi all,

After i compile my java program using gcj in cygwin and execute the output file i get 
"Thread.start called but threads not available"

When I check GCJ it seems it has been build with thread support (see below).
I compile using: gcj --main=Test -g0 -o test *java

A Test.java which is basicly a class with a main method which initializes a Tester 
object (extends Thread) and then starts it.

What am I doing wrong?


I have installed/upgraded to the lastest cygwin version.

$ gcj -v
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.2/specs
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../libgcj.spec
rename spec lib to liborig
Configured with: /netrel/src/gcc-3.2-3/configure --enable-languages=c,c++,f77,java 
--enable-libgcj
--enable-threads=posix --with-system-zlib --enable-nls --without-included-gettext 
--enable-interpreter --disable-sjlj-exceptions
--disable-version-specific-runtime-libs --enable-shared --build=i686-pc-linux
--host=i686-pc-cygwin --target=i686-pc-cygwin --enable-haifa --prefix=/usr
--exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib 
--includedir=/nonexistent/include --libexecdir=/usr/sbin
Thread model: posix
gcc version 3.2 20020927 (prerelease)


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/