From owner-freebsd-java Sun Mar 4 23:36:27 2001 Delivered-To: freebsd-java@freebsd.org Received: from osku.suutari.iki.fi (osku.syncrontech.com [213.28.98.4]) by hub.freebsd.org (Postfix) with ESMTP id 1457137B719 for ; Sun, 4 Mar 2001 23:36:19 -0800 (PST) (envelope-from ari@suutari.iki.fi) Received: from coffee (adsl-nat.syncrontech.com [213.28.98.3]) by osku.suutari.iki.fi (8.9.3/8.9.3) with SMTP id JAA30147; Mon, 5 Mar 2001 09:36:09 +0200 (EET) (envelope-from ari@suutari.iki.fi) Message-ID: <000e01c0a547$04859be0$0e05a8c0@coffee> From: "Ari Suutari" To: "Peter Eccles" , References: <20010228194546.A58208@mirriwinni.cse.rmit.edu.au> Subject: Re: current commmapi native drivers (patches included) Date: Mon, 5 Mar 2001 09:36:38 +0200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_000B_01C0A557.C6D9BC70" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org This is a multi-part message in MIME format. ------=_NextPart_000_000B_01C0A557.C6D9BC70 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi again, > Ive seen messages on this list about patches, but haven't found any > references to where they might be found. > Here are patches for FreeBSD CommAPI that replace select with poll. They also change serial parameters so that instead of reading one character at time inter-character timer is used to bursts of characters (which should be more efficient). I have been using this version with native FreeBSD jdk 1.2.2 for some time and it seems to work OK. Ari S. ------=_NextPart_000_000B_01C0A557.C6D9BC70 Content-Type: application/octet-stream; name="commapi.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="commapi.patch" *** orig/FreeBSD_CommAPI/src/org/freebsd/io/comm/libSerial.c Mon Jul 19 = 11:45:04 1999=0A= --- FreeBSD_CommAPI/src/org/freebsd/io/comm/libSerial.c Mon Mar 5 = 17:21:42 2001=0A= ***************=0A= *** 38,43 ****=0A= --- 38,44 ----=0A= #include =0A= #include =0A= #include =0A= + #include =0A= #include =0A= #include =0A= #include =0A= ***************=0A= *** 579,588 ****=0A= { =0A= int state,old_state;=0A= int fd;=0A= - fd_set rfds;=0A= - struct timeval sleep;=0A= int size;=0A= int ret;=0A= =0A= jfieldID jfield; =0A= jmethodID method, interrupt;=0A= --- 580,588 ----=0A= { =0A= int state,old_state;=0A= int fd;=0A= int size;=0A= int ret;=0A= + struct pollfd pf;=0A= =0A= jfieldID jfield; =0A= jmethodID method, interrupt;=0A= ***************=0A= *** 595,613 ****=0A= jthread =3D (*env)->FindClass( env, "java/lang/Thread" );=0A= interrupt =3D (*env)->GetStaticMethodID( env, jthread, = "interrupted", "()Z" );=0A= = =0A= ! FD_ZERO( &rfds );=0A= ! FD_SET( fd, &rfds );=0A= ! sleep.tv_sec =3D 1; /* Check every 1 second, or on receive = data */=0A= ! sleep.tv_usec =3D 0;=0A= =0A= /* Initialization of the current tty state */=0A= ioctl( fd, TIOCMGET, &old_state); = =0A= =0A= while( !interrupted ) =0A= {=0A= do =0A= {=0A= ! ret=3Dselect( fd + 1, &rfds, NULL, NULL, &sleep );=0A= } =0A= while ( (ret < 0) && (errno=3D=3DEINTR));=0A= =0A= --- 595,615 ----=0A= jthread =3D (*env)->FindClass( env, "java/lang/Thread" );=0A= interrupt =3D (*env)->GetStaticMethodID( env, jthread, = "interrupted", "()Z" );=0A= = =0A= ! pf.fd =3D fd;=0A= ! pf.events =3D POLLIN;=0A= ! pf.revents =3D POLLIN;=0A= =0A= /* Initialization of the current tty state */=0A= ioctl( fd, TIOCMGET, &old_state); = =0A= =0A= while( !interrupted ) =0A= {=0A= + /*=0A= + * Let other threads do their work.=0A= + */=0A= do =0A= {=0A= ! ret =3D poll (&pf, 1, 1000);=0A= } =0A= while ( (ret < 0) && (errno=3D=3DEINTR));=0A= =0A= ------=_NextPart_000_000B_01C0A557.C6D9BC70-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message