>>>>> Scott Murray writes:

    Scott> On Mon, 29 Nov 1999, Artur Biesiadowski wrote:
    >> Has anybody implemented it already ? Sun does not seem to try
    >> to solve the subject, but I suppose that it should be possible
    >> to add select like functionality on top of current jdk
    >> (including some native code of course).
    >> 
    >> I'm not thinking about being particulary portable here - as
    >> long as I can run it on any 2.2.x linux kernel (no need of
    >> windows/solaris compatibility).

    Scott> Sun have been working on some kind of poll extension, but
    Scott> AFAIK it is only available in some of their Solaris
    Scott> Production JDK's.

Yep, there's some demo code in the Solaris production release.

http://guiness.cs.uni-dortmund.de/~kreilede/poller/poller.tar.bz2
contains both the unmodified Solaris version and a version I've
modified for Linux.  (I've only changed things to get it working on
Linux at all, it's not tuned and it doesn't work reliable yet.)

Compile with: 
gcc -O2 -o libpoller.so -shared -D_REENTRANT -I/usr/local/jdk1.2.2/include 
-I/usr/local/jdk1.2.2/include/linux Poller.c

Here are some results from a simple test on a single machine:

With 'java Client 1000':
------------------------
$ LD_LIBRARY_PATH=. java SimpleServer
Serv: Initializing port 4444
Receiving 1024000 bytes from 1000 client connections
Time for all reads (1000 sockets) : 95595

$ JAVA_COMPILER=NONE LD_LIBRARY_PATH=. java PollingServer
Serv: Initializing port 4444
Receiving 1024000 bytes from 1000 client connections
Time for all reads (1000 sockets) : 49283


With 'java Client 2000':
------------------------

$ java SimpleServer
Serv: Initializing port 4444
Receiving 1024000 bytes from 2000 client connections
Time for all reads (2000 sockets) : 313702

$ JAVA_COMPILER=NONE LD_LIBRARY_PATH=. java PollingServer
Serv: Initializing port 4444
Receiving 1024000 bytes from 2000 client connections
Time for all reads (2000 sockets) : 118728



        Juergen

-- 
Juergen Kreileder, Blackdown Java-Linux Porting Team
http://www.blackdown.org/java-linux.html


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to