Operating System - HP-UX
1837903 Members
3201 Online
110124 Solutions
New Discussion

-doCloseWithReadPending Java option

 
Levilance Silva_1
Occasional Contributor

-doCloseWithReadPending Java option

In future versions of the jdk for HP-UX 11 will the '-doCloseWithReadPending' still be available?

Is there a reason why this option has to be specified in HP-UX 11 and not in HP-UX 10.20?
Can someone enlighten me please.

Regards,
Levi
There are 3 types of people those that can count and those that can't.
3 REPLIES 3
Alex Glennie
Honored Contributor

Re: -doCloseWithReadPending Java option

I suspect it occurs at 11.xx and not at 10.20 due to 64 bit capabilities and thread programming issues.

doCloseWithReadPending option :

With this option we store the thread id that is just about to read() on a linked list of threads that are reading on that file descriptor. When the read() completes the thread id is removed from the list again. When we perform a close() we walk through the list of reading threads and send them a signal to get them to terminate the the read() so the close() will succeed.

I would have thought once introduced it will continue, though that's not an Official answer ;)
Levilance Silva_1
Occasional Contributor

Re: -doCloseWithReadPending Java option

>With this option we store the thread id that
>is just about to read() on a linked list of >threads that are reading on that file
>descriptor. When the read() completes the
>thread id is removed from the list again.
>When we perform a close() we walk through
>the list of reading threads and send them a
>signal to get them to terminate the the read
>() so the close() will succeed.

A file descriptor is mentioned here. What about for sockets? Any differences? I've tested jdk1.1.8 and the close() method in PlainSocketImpl.java calls socketClose() which gets blocked (because another thread is reading from the same socket). By specifying 'doCloseWithReadPending' the socket is forced to close.

There are 3 types of people those that can count and those that can't.
Alex Glennie
Honored Contributor

Re: -doCloseWithReadPending Java option

I think we missed the point : it's not so much related to the O/S but the version of Java so my earlier comment may not have been entirely correct :

The HP-UX Developer's Kit for Java?(JDK) 1.1.8 releases for HP-UX 11.00 and for HP-UX 10.20 provide the solutions necessary to develop or deploy performance-enhanced Java applications on HP 9000 Enterprise Servers, HP 9000 Workstations, and HP Visualize Workstations.

Beginning with version 1.18.00 we included HP's new JIT compiler, which provides a
substantial boost at runtime. Beginning with version 1.18.00, we also included a number of new command line options which are summarized below (and further documented in the Documentation section):

The -doCloseWithReadPending option allows you to close() a socket when there is an
outstanding read pending on another thread.

New Option: -doCloseWithReadPending

The java, java_g, jre, and jre_g command line option -doCloseWithReadPending allows you to close() a socket when there is an outstanding read pending on another thread. Without this option, if close() is called on a socket which already has an outstanding blocked call on another thread, the close would block until the other call returned. With the option, close completes and the other thread takes a SocketException with the message "Socket closed".

I beleive it was introduced due tovorrect timing issues / bugs wrt complier , threads etc ...

I see no reason why the Java Labs would suddenly drop support or offer no backward compatibility for future versions of the JDK though it would be wise to check your current versions release notes etc details :

see http://www.unix.hp.com/java/index.html